Prevent crash if s == NULL

This commit is contained in:
Holger Vogt 2023-06-07 16:25:24 +02:00
parent 7f8e1cecab
commit d46cd894cc
1 changed files with 2 additions and 0 deletions

View File

@ -1395,6 +1395,8 @@ nupa_assignment(dico_t *dico, const char *s, char mode)
bug: we cannot rely on the transformed line, must re-parse everything!
*/
{
if (!s || !*s)
return 1;
/* s has the format: ident = expression; ident= expression ... */
const char * const s_end = s + strlen(s);
const char *p = s;