Skip to content

Commit

Permalink
Backport from devbranch:
Browse files Browse the repository at this point in the history
Fixed zip archiver: could do bogus seek if a small, non-zip file got put
 through isArchive().
  • Loading branch information
icculus committed May 5, 2007
1 parent 625e8e8 commit fc6d85b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG
Expand Up @@ -4,6 +4,8 @@

-- stuff in the stable-1.0 branch, backported from 2.0.0 dev branch, etc ---

05052007 - Fixed zip archiver: could do bogus seek if a small, non-zip file
got put through isArchive().
04022007 - Fixed Doxygen comment.
03312007 - Moved DIR archiver to start of the list, so we don't have to have
every other archiver fail to open a directory as a file before
Expand Down
2 changes: 2 additions & 0 deletions archivers/zip.c
Expand Up @@ -489,6 +489,8 @@ static PHYSFS_sint64 zip_find_end_of_central_dir(void *in, PHYSFS_sint64 *len)
break;

filepos -= (maxread - 4);
if (filepos < 0)
filepos = 0;
} /* while */

BAIL_IF_MACRO(!found, ERR_NOT_AN_ARCHIVE, -1);
Expand Down

0 comments on commit fc6d85b

Please sign in to comment.