From f3191d0e85ed14d5a5e47f26656bf5b829dbfd99 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Sun, 20 Jul 2003 21:13:25 +0000 Subject: [PATCH] Off-by-one fix by Dieter Baron...fixes segfault in zip archive searching in certain cases. --- archivers/zip.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/archivers/zip.c b/archivers/zip.c index 45c7820e..5cc2f7eb 100644 --- a/archivers/zip.c +++ b/archivers/zip.c @@ -1187,7 +1187,7 @@ static PHYSFS_sint32 zip_find_start_of_dir(ZIPinfo *info, const char *path, int stop_on_first_find) { PHYSFS_sint32 lo = 0; - PHYSFS_sint32 hi = (PHYSFS_sint32) info->entryCount; + PHYSFS_sint32 hi = (PHYSFS_sint32) (info->entryCount - 1); PHYSFS_sint32 middle; PHYSFS_uint32 dlen = strlen(path); PHYSFS_sint32 retval = -1;