8330615: avoid signed integer overflows in zip_util.c readCen / hashN

Reviewed-by: lucy, mdoerr
This commit is contained in:
Matthias Baesken 2024-04-25 15:23:48 +00:00
parent 4dfaa9b5bd
commit 5af6b45eef

View File

@ -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;