mirror of
https://github.com/json-c/json-c.git
synced 2026-03-28 17:39:07 +08:00
Fix issue #875: cast to unsigned char so bytes above 0x7f aren't interpreted as negative, which was causing the strict-mode control characters check to incorrectly trigger.
This commit is contained in:
@@ -678,7 +678,7 @@ struct json_object *json_tokener_parse_ex(struct json_tokener *tok, const char *
|
||||
state = json_tokener_state_string_escape;
|
||||
break;
|
||||
}
|
||||
else if ((tok->flags & JSON_TOKENER_STRICT) && c <= 0x1f)
|
||||
else if ((tok->flags & JSON_TOKENER_STRICT) && (unsigned char)c <= 0x1f)
|
||||
{
|
||||
// Disallow control characters in strict mode
|
||||
tok->err = json_tokener_error_parse_string;
|
||||
|
||||
Reference in New Issue
Block a user