From: Dmitry Volyntsev Date: Thu, 9 Jan 2020 12:54:52 +0000 (+0300) Subject: Fixed integer overflow in njs_typed_array_constructor(). X-Git-Tag: 0.3.8~13 X-Git-Url: http://git.kaiwu.me/postgresql/log/contrib/postgres_fdw/static/gitweb.js?a=commitdiff_plain;h=abb6e94f8b6e18cb7ea9ea7f09cdd2a96650df0b;p=njs.git Fixed integer overflow in njs_typed_array_constructor(). Found by Coverity (CID 1457371). --- 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)) {