]> git.kaiwu.me - njs.git/commit
Fixed Function.prototype.apply() with slow arrays.
authorDmitry Volyntsev <xeioex@nginx.com>
Wed, 19 Jan 2022 14:03:49 +0000 (14:03 +0000)
committerDmitry Volyntsev <xeioex@nginx.com>
Wed, 19 Jan 2022 14:03:49 +0000 (14:03 +0000)
commit39e8fa1b7db1680654527f8fa0e9ee93b334ecba
treea5cbfae5dc52ea2d1c05f5d4b4a13a8c8a8f27a2
parent6a40a85ff239497c6458c7dbef18f6a2736fe992
Fixed Function.prototype.apply() with slow arrays.

Previously, the function had two issues:
   * array->start was referenced without checking for fast array flag
   * the created arguments list was not sanity-checked for its length,
     which can be very large.

The fix is to remove micro-optimization for arrays and introduce limit
size for arguments list.

This closes #449 issue in Github.
src/njs_function.c
src/test/njs_unit_test.c