From 5064048ec3039cb11be545c975b67a997f054dde Mon Sep 17 00:00:00 2001 From: that Date: Sun, 30 Aug 2015 12:08:05 +0200 Subject: Improve error handling for zip install - minzip: don't crash with corrupted zips (e.g. 4096 null bytes) - twinstall: output error when zip doesn't contain update-binary - twinstall: add strerror(errno) to system-level errors - twinstall: correct message if /file_contexts could not be extracted - twinstall: use TWFunc::Wait_For_Child for better waitpid errors - twinstall: minor code cleanup Change-Id: I53b156b0ec08755af2742bb71d1523ae38f4a82e --- minzip/Zip.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'minzip') diff --git a/minzip/Zip.c b/minzip/Zip.c index 40712e03a..c6272509f 100644 --- a/minzip/Zip.c +++ b/minzip/Zip.c @@ -427,6 +427,8 @@ int mzOpenZipArchive(unsigned char* addr, size_t length, ZipArchive* pArchive) { int err; + memset(pArchive, 0, sizeof(ZipArchive)); + if (length < ENDHDR) { err = -1; LOGV("File '%s' too small to be zip (%zd)\n", fileName, map.length); -- cgit v1.2.3