Skip to content

Commit

Permalink
zip: fail with correct error code if opening a directory.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Jul 17, 2017
1 parent e84277a commit 63de092
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/archiver_zip.c
Expand Up @@ -1545,6 +1545,7 @@ static PHYSFS_Io *ZIP_openRead(void *opaque, const char *filename)
} /* if */

BAIL_IF_ERRPASS(!entry, NULL);
BAIL_IF(entry->tree.isdir, PHYSFS_ERR_NOT_A_FILE, NULL);

retval = (PHYSFS_Io *) allocator.Malloc(sizeof (PHYSFS_Io));
GOTO_IF(!retval, PHYSFS_ERR_OUT_OF_MEMORY, ZIP_openRead_failed);
Expand Down

0 comments on commit 63de092

Please sign in to comment.