]> git.kaiwu.me - njs.git/commitdiff
Fixed "length" may be uninitialized in njs_typed_array_constructor().
authorDmitry Volyntsev <xeioex@nginx.com>
Fri, 27 Dec 2019 16:17:26 +0000 (19:17 +0300)
committerDmitry Volyntsev <xeioex@nginx.com>
Fri, 27 Dec 2019 16:17:26 +0000 (19:17 +0300)
Found by Clang static analyzer.

src/njs_typed_array.c

index 6c35ea1141b770a1b49a24cc96f19f909e4bfd3b..9d4c482c823d2d722dec939a4f79b1676b8caa1f 100644 (file)
@@ -23,6 +23,7 @@ njs_typed_array_constructor(njs_vm_t *vm, njs_value_t *args, njs_uint_t nargs,
     njs_array_buffer_t  *buffer;
 
     size = 0;
+    length = 0;
     offset = 0;
 
     buffer = NULL;