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>
master
Jouni Malinen 5 years ago
parent 0dedcb3154
commit 1e5506588d

@ -103,6 +103,11 @@ static char * json_parse_string(const char **json_pos, const char *end)
return str;
case '\\':
pos++;
if (pos >= end) {
wpa_printf(MSG_DEBUG,
"JSON: Truncated \\ escape");
goto fail;
}
switch (*pos) {
case '"':
case '\\':

Loading…
Cancel
Save