[PATH] fix segfault in fsck-cache
- From
- Andreas Gal <gal@uci.edu>
- Date
- Apr 24, 2005, 05:05 UTC
- Message-ID
- <Pine.LNX.4.58.0504232202380.7195@sam.ics.uci.edu>
- In-Reply-To
- <Pine.LNX.4.58.0504232153500.15879@ppc970.osdl.org>
I somehow got some corrupted object files in my repository that zlib refuses to decompress. This patch makes sure we abort early before the memcpy a few lines downtream segfaults (due to total_out == 0).
Andreas
Signed-off-by: Andreas Gal <gal@uci.edu>
--- 66308ede85c2dad6b184fb74a7215b06a173d8f7/sha1_file.c +++ sha1_file.c
@@ -155,6 +155,8 @@ inflateInit(&stream); ret = inflate(&stream, 0); + if (ret != Z_OK) + return NULL; if (sscanf(buffer, "%10s %lu", type, size) != 2) return NULL;