Fix #348: reject unescaped control chars

This commit is contained in:
Nicolas Williams committed 2014-12-24 00:01:43 -06:00
1 parent 2775b90b20
commit 8ca07a08c3
1 file changed
+2
+2
View File
@@ -257,6 +257,8 @@ static pfunc found_string(struct jv_parser* p) {
return "Invalid escape"; return "Invalid escape";
} }
} else { } else {
if (c < 0x001f)
return "Invalid string: control characters from U+0000 through U+001F must be escaped";
*out++ = c; *out++ = c;
} }
} }