Download scripts/arraylit_elemfix_backport.diff from shawnnnliu/Hardened_SEC-Bench: direct link, hf CLI and curl.
- Browser
- Download file 649 Bytes
-
https://huggingface.co/datasets/shawnnnliu/Hardened_SEC-Bench/resolve/main/scripts/arraylit_elemfix_backport.diff
- Command line
-
hf download hf://datasets/shawnnnliu/Hardened_SEC-Bench/scripts/arraylit_elemfix_backport.diff
-
curl -L -o arraylit_elemfix_backport.diff https://huggingface.co/datasets/shawnnnliu/Hardened_SEC-Bench/resolve/main/scripts/arraylit_elemfix_backport.diff
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 | |
| 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; | |