Kaynağa Gözat

Off-by-one fix by Dieter Baron...fixes segfault in zip archive searching in
certain cases.

Ryan C. Gordon 22 yıl önce
ebeveyn
işleme
f3191d0e85
1 değiştirilmiş dosya ile 1 ekleme ve 1 silme
  1. 1 1
      archivers/zip.c

+ 1 - 1
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)
                                             int stop_on_first_find)
 {
 {
     PHYSFS_sint32 lo = 0;
     PHYSFS_sint32 lo = 0;
-    PHYSFS_sint32 hi = (PHYSFS_sint32) info->entryCount;
+    PHYSFS_sint32 hi = (PHYSFS_sint32) (info->entryCount - 1);
     PHYSFS_sint32 middle;
     PHYSFS_sint32 middle;
     PHYSFS_uint32 dlen = strlen(path);
     PHYSFS_uint32 dlen = strlen(path);
     PHYSFS_sint32 retval = -1;
     PHYSFS_sint32 retval = -1;