[c] Error in color parsing, off-by-one resulting in invalid memory access. Closes #1031. Thanks @minggo for the adress sanitizer hint.

This commit is contained in:
badlogic 2017-11-02 11:20:57 +01:00
parent 095fe71ff8
commit 361378b275

View File

@ -93,7 +93,8 @@ static float toColor (const char* value, int index) {
char *error;
int color;
if (strlen(value) / 2 < index) return -1;
if (index >= strlen(value) / 2)
return -1;
value += index * 2;
digits[0] = *value;