added check for null pointer before fixing tokens after parsing is done

master
Serge A. Zaitsev 9 years ago
parent 824d9a769c
commit aedc121ce8

@ -289,12 +289,14 @@ int jsmn_parse(jsmn_parser *parser, const char *js, size_t len,
}
}
if (tokens != NULL) {
for (i = parser->toknext - 1; i >= 0; i--) {
/* Unmatched opened object or array */
if (tokens[i].start != -1 && tokens[i].end == -1) {
return JSMN_ERROR_PART;
}
}
}
return count;
}

Loading…
Cancel
Save