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:
alexey.lysiuk 2017-09-23 11:57:06 +03:00
parent 789214200c
commit f174111128

View file

@ -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;