mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2024-11-28 18:28:23 -05:00
JSON: Fix string parsing when \\ escape is at the end of buffer
This would have resulted in reading one octet past the end of the buffer before rejecting the string. Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
0dedcb3154
commit
1e5506588d
@ -103,6 +103,11 @@ static char * json_parse_string(const char **json_pos, const char *end)
|
|||||||
return str;
|
return str;
|
||||||
case '\\':
|
case '\\':
|
||||||
pos++;
|
pos++;
|
||||||
|
if (pos >= end) {
|
||||||
|
wpa_printf(MSG_DEBUG,
|
||||||
|
"JSON: Truncated \\ escape");
|
||||||
|
goto fail;
|
||||||
|
}
|
||||||
switch (*pos) {
|
switch (*pos) {
|
||||||
case '"':
|
case '"':
|
||||||
case '\\':
|
case '\\':
|
||||||
|
Loading…
Reference in New Issue
Block a user