[njs] Fixed njs_array_alloc() for length > 2**31.

Dmitry Volyntsev xeioex at nginx.com
Wed Sep 19 16:45:37 UTC 2018


details:   http://hg.nginx.org/njs/rev/731e29c2b41e
branches:  
changeset: 611:731e29c2b41e
user:      Dmitry Volyntsev <xeioex at nginx.com>
date:      Wed Sep 19 19:24:07 2018 +0300
description:
Fixed njs_array_alloc() for length > 2**31.

diffstat:

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

diffs (12 lines):

diff -r da303066654d -r 731e29c2b41e njs/njs_array.c
--- a/njs/njs_array.c	Wed Sep 19 19:24:05 2018 +0300
+++ b/njs/njs_array.c	Wed Sep 19 19:24:07 2018 +0300
@@ -117,7 +117,7 @@ njs_array_alloc(njs_vm_t *vm, uint32_t l
         goto memory_error;
     }
 
-    size = length + spare;
+    size = (size_t) length + spare;
 
     if (nxt_slow_path(size * sizeof(njs_value_t) < size)) {
         goto memory_error;


More information about the nginx-devel mailing list