mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-24 13:11:33 +00:00
Fixed read beyond buffer boundary during font color parsing
Printing of string that ends with '\c' led to undefined behavior Example: 'echo \c' in console
This commit is contained in:
parent
789214200c
commit
f174111128
1 changed files with 2 additions and 2 deletions
|
@ -2666,7 +2666,7 @@ EColorRange V_ParseFontColor (const uint8_t *&color_value, int normalcolor, int
|
|||
}
|
||||
else // Incomplete!
|
||||
{
|
||||
color_value = ch - (*ch == '\0');
|
||||
color_value = ch - (newcolor == '\0');
|
||||
return CR_UNDEFINED;
|
||||
}
|
||||
color_value = ch;
|
||||
|
@ -2772,4 +2772,4 @@ DEFINE_ACTION_FUNCTION(FFont, GetCursor)
|
|||
{
|
||||
PARAM_SELF_STRUCT_PROLOGUE(FFont);
|
||||
ACTION_RETURN_STRING(FString(self->GetCursor()));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue