diff options
author | Remi Collet <fedora@famillecollet.com> | 2013-08-06 10:41:14 +0200 |
---|---|---|
committer | Remi Collet <fedora@famillecollet.com> | 2013-08-06 10:41:14 +0200 |
commit | a07ef3d19763094ab35cc009657c85bcbb9dd9ae (patch) | |
tree | e6345abefa0bb730e1f875cf7b53782e6edcc7a2 | |
parent | b3bce4d5943774b59d7fa653da89f48db70d013e (diff) | |
download | json-c-a07ef3d19763094ab35cc009657c85bcbb9dd9ae.tar.gz |
no single-quote string in strict mode
-rw-r--r-- | json_tokener.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/json_tokener.c b/json_tokener.c index a6924a1..45390ac 100644 --- a/json_tokener.c +++ b/json_tokener.c @@ -293,8 +293,13 @@ struct json_object* json_tokener_parse_ex(struct json_tokener *tok, printbuf_reset(tok->pb); tok->st_pos = 0; goto redo_char; - case '"': case '\'': + if (tok->flags & JSON_TOKENER_STRICT) { + /* in STRICT mode only double-quote are allowed */ + tok->err = json_tokener_error_parse_unexpected; + goto out; + } + case '"': state = json_tokener_state_string; printbuf_reset(tok->pb); tok->quote_char = c; |