]> git.kaiwu.me - njs.git/commit
Fixed heap-use-after-free in JSON.stringify().
authorAlexander Borisov <alexander.borisov@nginx.com>
Tue, 6 Oct 2020 17:24:21 +0000 (20:24 +0300)
committerAlexander Borisov <alexander.borisov@nginx.com>
Tue, 6 Oct 2020 17:24:21 +0000 (20:24 +0300)
commit63aa001ebd7a386939851cf8b2c0332d718f5c23
treefe5c987f8812c29815e45d6dd91de60c7f25f3f9
parent9ab425eac2b6c7eb3a932c8e6934e9992435e328
Fixed heap-use-after-free in JSON.stringify().

njs_json_stringify_iterator() assumed, while stringifying flat arrays, that a
flat array will always remain flat.  This is not the case for flat arrays with
values with custom getters which may modify the enclosing array upon
invocation.

This closes #322 issue on GitHub.
src/njs_json.c
src/test/njs_unit_test.c