Avoid invalid memory read in json_pack()

Initial patch by @bharjoc-bitdefender

Fixes #421
This commit is contained in:
Petri Lehtinen 2018-07-09 22:26:35 +03:00
parent b59ac57617
commit aed855e692

View File

@ -75,6 +75,9 @@ static void next_token(scanner_t *s)
return;
}
if (!token(s) && !*s->fmt)
return;
t = s->fmt;
s->column++;
s->pos++;
@ -97,7 +100,7 @@ static void next_token(scanner_t *s)
s->token.column = s->column;
s->token.pos = s->pos;
t++;
if (*t) t++;
s->fmt = t;
}