From fee2b0c60105f8161d4e46c4587965dfb44cd302 Mon Sep 17 00:00:00 2001 From: Haonan Date: Wed, 6 Nov 2024 10:14:08 +0800 Subject: [PATCH] Fix code scanning alert no. 11: Multiplication result converted to larger type (#287) Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> --- cpp/third_party/zlib-1.2.13/zutil.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/third_party/zlib-1.2.13/zutil.c b/cpp/third_party/zlib-1.2.13/zutil.c index 9543ae825..34129b578 100644 --- a/cpp/third_party/zlib-1.2.13/zutil.c +++ b/cpp/third_party/zlib-1.2.13/zutil.c @@ -310,7 +310,7 @@ voidpf ZLIB_INTERNAL zcalloc(opaque, items, size) unsigned size; { (void)opaque; - return sizeof(uInt) > 2 ? (voidpf)malloc(items * size) : + return sizeof(uInt) > 2 ? (voidpf)malloc((size_t)items * size) : (voidpf)calloc(items, size); }