From 13855849e6390d99f98fe75a8b412331b21ec643 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Sat, 8 Sep 2012 22:18:52 -0400 Subject: [PATCH] Fixed infinite loop (thanks, Sam!) --- src/archiver_zip.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/archiver_zip.c b/src/archiver_zip.c index c6efc70a..b1663c60 100644 --- a/src/archiver_zip.c +++ b/src/archiver_zip.c @@ -1184,14 +1184,14 @@ static PHYSFS_sint64 zip64_find_end_of_central_dir(PHYSFS_Io *io, /* we assume you can eat this stack if you handle Zip64 files. */ PHYSFS_uint8 buf[256 * 1024]; PHYSFS_uint64 len = pos - offset; - PHYSFS_uint32 i; + PHYSFS_sint32 i; if (len > sizeof (buf)) len = sizeof (buf); BAIL_IF_MACRO(!io->seek(io, pos - len), ERRPASS, -1); BAIL_IF_MACRO(!__PHYSFS_readAll(io, buf, len), ERRPASS, -1); - for (i = len - 4; i >= 0; i--) + for (i = (PHYSFS_sint32) (len - 4); i >= 0; i--) { if (buf[i] != 0x50) continue;