patch: unzip succeeds with CRC errors

Paul Fox pgf at brightstareng.com
Fri Mar 24 20:29:47 UTC 2006


i assume unzip should return failure in the presence of
crc errors, correct?  i'll apply this unless there are
objections.

paul

Index: unzip.c
===================================================================
--- unzip.c	(revision 14650)
+++ unzip.c	(working copy)
@@ -116,11 +116,11 @@
 		inflate_cleanup();
 		/* Validate decompression - crc */
 		if (zip_header->formated.crc32 != (gunzip_crc ^ 0xffffffffL)) {
-			bb_error_msg("Invalid compressed data--crc error");
+			bb_error_msg_and_die("Invalid compressed data--crc error");
 		}
 		/* Validate decompression - size */
 		if (zip_header->formated.ucmpsize != gunzip_bytes_out) {
-			bb_error_msg("Invalid compressed data--length error");
+			bb_error_msg_and_die("Invalid compressed data--length error");
 		}
 	}
 }


=---------------------
 paul fox, pgf at brightstareng.com



More information about the busybox mailing list