From 5af6b45eefd227e3e046ca22a404ae8a23174160 Mon Sep 17 00:00:00 2001 From: Matthias Baesken Date: Thu, 25 Apr 2024 15:23:48 +0000 Subject: [PATCH] 8330615: avoid signed integer overflows in zip_util.c readCen / hashN Reviewed-by: lucy, mdoerr --- src/java.base/share/native/libzip/zip_util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/java.base/share/native/libzip/zip_util.c b/src/java.base/share/native/libzip/zip_util.c index a996b450ad4..8f2f19c66a2 100644 --- a/src/java.base/share/native/libzip/zip_util.c +++ b/src/java.base/share/native/libzip/zip_util.c @@ -437,7 +437,7 @@ hash(const char *s) static unsigned int hashN(const char *s, int length) { - int h = 0; + unsigned int h = 0; while (length-- > 0) h = 31*h + *s++; return h;