[njs] Fixed out-of-bounds read.

Dmitry Volyntsev xeioex at nginx.com
Tue Aug 28 15:37:21 UTC 2018


details:   http://hg.nginx.org/njs/rev/cfd82c5cfa93
branches:  
changeset: 590:cfd82c5cfa93
user:      Dmitry Volyntsev <xeioex at nginx.com>
date:      Tue Aug 28 15:37:14 2018 +0300
description:
Fixed out-of-bounds read.

Found by Coverity (CID 1438786).

diffstat:

 njs/njs_function.c |  2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diffs (12 lines):

diff -r 50dfb4ccbceb -r cfd82c5cfa93 njs/njs_function.c
--- a/njs/njs_function.c	Mon Aug 27 19:19:25 2018 +0300
+++ b/njs/njs_function.c	Tue Aug 28 15:37:14 2018 +0300
@@ -517,7 +517,7 @@ njs_function_prototype_length(njs_vm_t *
     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;
             }


More information about the nginx-devel mailing list