1. Serge Zaitsev
  2. jsmn
Issue #2 resolved

wrong parser position after JSMN_ERROR_NOMEM

Anonymous created an issue

If after reading the primitive or string, we can not get token, parser->pos becomes invalid

fix :

change in jsmn_parse_primitive and jsmn_parse_string {{{

!c

if (token == NULL) return JSMN_ERROR_NOMEM; }}}

to

{{{

!c

if (token == NULL) { parser->pos = start; return JSMN_ERROR_NOMEM; } }}}

Comments (1)

  1. Log in to comment