From ac9d2241c239b42c2876d6f095aaa8838838a33c Mon Sep 17 00:00:00 2001 From: Jukka Ojanen Date: Thu, 2 Sep 2021 16:03:25 +0300 Subject: [PATCH] Increase unzReadCurrentFile() chunk size to INT_MAX --- src/filehandling.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/filehandling.c b/src/filehandling.c index c890129c3..7c9fffdd1 100644 --- a/src/filehandling.c +++ b/src/filehandling.c @@ -421,7 +421,7 @@ size_t hc_fread (void *ptr, size_t size, size_t nmemb, HCFILE *fp) do { - unsigned chunk = (len > HCFILE_CHUNK_SIZE) ? HCFILE_CHUNK_SIZE : (unsigned) len; + unsigned chunk = (len > INT_MAX) ? INT_MAX : (unsigned) len; int result = unzReadCurrentFile (fp->ufp, (unsigned char *) ptr + pos, chunk); if (result < 0) return (size_t) -1; pos += (u64) result;