Hardened_SEC-Bench / scripts /arraylit_elemfix_backport.diff
shawnnnliu's picture
Add five instances to the verified config and rebuild its table (part 3)
b77d04b verified
Raw History Blame Contribute Delete
649 Bytes
diff --git a/src/njs_vmcode.c b/src/njs_vmcode.c
index ef0beb5e..b4478d26 100644
--- a/src/njs_vmcode.c
+++ b/src/njs_vmcode.c
@@ -1272,6 +1272,15 @@ njs_vmcode_property_init(njs_vm_t *vm, njs_value_t *value, njs_value_t *key,
index = (uint32_t) num;
array = value->data.u.array;
+ if (njs_slow_path(!array->object.fast_array)) {
+ ret = njs_value_property_i64_set(vm, value, index, init);
+ if (njs_slow_path(ret == NJS_ERROR)) {
+ return NJS_ERROR;
+ }
+
+ break;
+ }
+
if (index >= array->length) {
size = index - array->length;