elm_prefs_cc: handle line too long for buffers

if a line from the cpp processor is too long (more than 4k) then abort
compilation as something is wrong asnd our buffers can't handle it
anyway.

@fix
This commit is contained in:
Carsten Haitzler 2017-06-08 11:54:15 +09:00
parent 45656ccb80
commit b9b0177d5e
1 changed files with 5 additions and 0 deletions

View File

@ -296,6 +296,11 @@ next_token(char *p, char *end, char **new_p, int *delim)
}
strncpy(tmpstr, p, l);
tmpstr[l] = 0;
if (l >= sizeof(fl))
{
ERR("Line too long: %i chars: %s", l, tmpstr);
exit(-1);
}
l = sscanf(tmpstr, "%*s %i \"%[^\"]\"", &nm, fl);
if (l == 2)
{