(svn r6884) -Codechange: Add strict bounds checking in string formatting system.
The last parameter should point to the end of the buffer (eg lastof(buf)) Courtesy of Tron.
This commit is contained in:
@@ -1017,7 +1017,7 @@ void UpdateViewportSignPos(ViewportSign *sign, int left, int top, StringID str)
|
||||
|
||||
sign->top = top;
|
||||
|
||||
GetString(buffer, str);
|
||||
GetString(buffer, str, lastof(buffer));
|
||||
w = GetStringBoundingBox(buffer).width + 3;
|
||||
sign->width_1 = w;
|
||||
sign->left = left - w / 2;
|
||||
|
||||
Reference in New Issue
Block a user