From 6069a793eaa2e11e0c53af0ab063d22fb1f9f531 Mon Sep 17 00:00:00 2001 From: nkk71 Date: Tue, 19 Jan 2016 16:36:47 +0200 Subject: minzip: Add support for >2GB zipfile normal zip limit is 4GB, but due to signed variables it will only access 2GB (32bit signed integer is from -2GB to +2GB). these changes allow for a theoretical limit of 4GB zips to be flashed. RAM restrictions still apply, and on a 32bit system it's likely to max out at approx 2.8GB flashable zip, above that mmap will probably fail. Note: the flashable zip also needs a compatible update-binary which include these changes. (this also applies to both aroma installer if it's being used). Change-Id: Ib3af2945c9bd4890a2e6dc45acfc2b80ec55473b --- minzip/Zip.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'minzip/Zip.c') diff --git a/minzip/Zip.c b/minzip/Zip.c index 1f035add5..f47a480f1 100644 --- a/minzip/Zip.c +++ b/minzip/Zip.c @@ -366,7 +366,7 @@ static bool parseZipArchive(ZipArchive* pArchive) } pEntry->offset = localHdrOffset + LOCHDR + get2LE(localHdr + LOCNAM) + get2LE(localHdr + LOCEXT); - if (!safe_add(NULL, pEntry->offset, pEntry->compLen)) { + if (!safe_add(NULL, pEntry->offset, (typeof(pEntry->offset))pEntry->compLen)) { LOGW("Integer overflow adding in parseZipArchive\n"); goto bail; } -- cgit v1.2.3