From abb6e94f8b6e18cb7ea9ea7f09cdd2a96650df0b Mon Sep 17 00:00:00 2001 From: Dmitry Volyntsev Date: Thu, 9 Jan 2020 15:54:52 +0300 Subject: [PATCH] Fixed integer overflow in njs_typed_array_constructor(). Found by Coverity (CID 1457371). --- src/njs_typed_array.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/njs_typed_array.c b/src/njs_typed_array.c index 9d4c482c..a7d683d0 100644 --- a/src/njs_typed_array.c +++ b/src/njs_typed_array.c @@ -85,7 +85,7 @@ njs_typed_array_constructor(njs_vm_t *vm, njs_value_t *args, njs_uint_t nargs, } else if (njs_is_typed_array(value)) { src_tarray = njs_typed_array(value); - size = njs_typed_array_length(src_tarray) * element_size; + size = (uint64_t) njs_typed_array_length(src_tarray) * element_size; } else if (njs_is_object(value)) { if (njs_is_array(value) && njs_object_hash_is_empty(value)) { -- 2.47.3