Issue #275: fix out of bounds read when handling unicode surrogate pairs.

This commit is contained in:
Eric Haszlakiewicz
2016-10-05 23:15:51 -04:00
parent 5fd99e62ed
commit 36a28fcb0c
3 changed files with 9 additions and 3 deletions

View File

@@ -44,6 +44,11 @@ static void test_basic_parse()
printf("new_obj.to_string()=%s\n", json_object_to_json_string(new_obj));
json_object_put(new_obj);
// Test with a "short" high surrogate
new_obj = json_tokener_parse("[9,'\\uDAD");
printf("new_obj.to_string()=%s\n", json_object_to_json_string(new_obj));
json_object_put(new_obj);
new_obj = json_tokener_parse("null");
printf("new_obj.to_string()=%s\n", json_object_to_json_string(new_obj));
json_object_put(new_obj);