Skip to content

Commit

Permalink
JSON.parse(): ensure jspHasError() is always checked
Browse files Browse the repository at this point in the history
  • Loading branch information
bobrippling committed Nov 27, 2023
1 parent 5440541 commit 693bd55
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/jswrap_json.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ JsVar *jswrap_json_parse_internal(JSONFlags flags) {
case '{': {
JsVar *obj = jsvNewObject(); if (!obj) return 0;
jslGetNextToken(); // {
while (lex->tk == LEX_STR || lex->tk == LEX_ID && !jspHasError()) {
while ((lex->tk == LEX_STR || lex->tk == LEX_ID) && !jspHasError()) {
if (!(flags&JSON_DROP_QUOTES)) {
jslMatch(LEX_STR);
return obj;
Expand Down

0 comments on commit 693bd55

Please sign in to comment.