]> git.kaiwu.me - njs.git/commitdiff
Fixed out-of-bounds read.
authorDmitry Volyntsev <xeioex@nginx.com>
Tue, 28 Aug 2018 12:37:14 +0000 (15:37 +0300)
committerDmitry Volyntsev <xeioex@nginx.com>
Tue, 28 Aug 2018 12:37:14 +0000 (15:37 +0300)
Found by Coverity (CID 1438786).

njs/njs_function.c

index 7aa5773e78d4aa64de3c8724fc53b4581801cd98..4227f24d9455ca5ee8c734113d28a4efcdcddbb3 100644 (file)
@@ -517,7 +517,7 @@ njs_function_prototype_length(njs_vm_t *vm, njs_value_t *value,
     function = value->data.u.function;
 
     if (function->native) {
-        for (n = function->args_offset; n <= NJS_ARGS_TYPES_MAX; n++) {
+        for (n = function->args_offset; n < NJS_ARGS_TYPES_MAX; n++) {
             if (function->args_types[n] == 0) {
                 break;
             }