mirror of
https://github.com/akheron/jansson.git
synced 2025-04-06 05:55:05 +00:00
Avoid invalid memory read in json_pack()
Initial patch by @bharjoc-bitdefender Fixes #421
This commit is contained in:
parent
b59ac57617
commit
aed855e692
1 changed files with 4 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue