Skip to content

Commit

Permalink
Use definitely existing error for checking for truncated archives.
Browse files Browse the repository at this point in the history
Closes #475.
  • Loading branch information
0-wiz-0 committed Dec 11, 2024
1 parent 3d25095 commit 6ba97d4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions THANKS
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ Shimi
Simon Talbot <[email protected]>
SpaceIm
Stephen Bryant <[email protected]>
sxkan
Tabata Shintaro <[email protected]>
takase1121
Tarmo Pikaro <[email protected]>
Expand Down
2 changes: 1 addition & 1 deletion lib/zip_open.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ _zip_open(zip_source_t *src, unsigned int flags, zip_error_t *error) {

if ((cdir = _zip_find_central_dir(za, len)) == NULL) {
_zip_error_copy(error, &za->error);
if (zip_error_code_zip(error) == ZIP_ER_NOZIP) {
if (zip_error_code_zip(&za->error) == ZIP_ER_NOZIP) {
/* not a zip - find out if it's truncated */
if (_is_truncated_zip(src)) {
zip_error_set(error, ZIP_ER_TRUNCATED_ZIP, 0);
Expand Down

0 comments on commit 6ba97d4

Please sign in to comment.