Fixed heap-use-after-free in JSON.parse().
This correctly fixes the issues addressed in 1405:9beb9ea093b5.
The initial fix wrongly assumed that the "value" pointer is still valid when
njs_is_fast_array(&state->value) is true and the pointer can be used for
the fast path. This is not the case when the array object is resized.
Moreover, the fast path branch may be completely eliminated because
JSON.parse() with the replacer function is relatively slow by itself.
This closes #323, #324, #325 issues on GitHub.
2 files changed