From: Remi Collet Date: Tue, 6 Aug 2013 08:41:14 +0000 (+0200) Subject: no single-quote string in strict mode X-Git-Tag: json-c-0.12-20140410~32^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a07ef3d19763094ab35cc009657c85bcbb9dd9ae;p=thirdparty%2Fjson-c.git no single-quote string in strict mode --- diff --git a/json_tokener.c b/json_tokener.c index a6924a1f..45390ac2 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;