Fix issue #53 - ensure explicit length string are still NUL terminated, and fix json_tokener_parse() to work properly with embedded unicode \u0000 values in strings.

Adjust test_null to check for this case.
See also http://bugs.debian.org/687269
This commit is contained in:
Eric Haszlakiewicz
2012-12-09 16:32:11 -06:00
parent 7a4506d6df
commit 4e4af93d66
3 changed files with 23 additions and 2 deletions

View File

@@ -393,7 +393,7 @@ struct json_object* json_tokener_parse_ex(struct json_tokener *tok,
while(1) {
if(c == tok->quote_char) {
printbuf_memappend_fast(tok->pb, case_start, str-case_start);
current = json_object_new_string(tok->pb->buf);
current = json_object_new_string_len(tok->pb->buf, tok->pb->bpos);
saved_state = json_tokener_state_finish;
state = json_tokener_state_eatws;
break;