Skip to content

Commit

Permalink
Make eocd checks more consistent between zip and zip64 cases.
Browse files Browse the repository at this point in the history
  • Loading branch information
0-wiz-0 committed Aug 29, 2017
1 parent e37a0ea commit 9b46957
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/zip_open.c
Expand Up @@ -847,7 +847,12 @@ _zip_read_eocd64(zip_source_t *src, zip_buffer_t *buffer, zip_uint64_t buf_offse
zip_error_set(error, ZIP_ER_SEEK, EFBIG);
return NULL;
}
if ((flags & ZIP_CHECKCONS) && offset+size != eocd_offset) {
if (offset+size > buf_offset + eocd_offset) {
/* cdir spans past EOCD record */
zip_error_set(error, ZIP_ER_INCONS, 0);
return NULL;
}
if ((flags & ZIP_CHECKCONS) && offset+size != buf_offset + eocd_offset) {
zip_error_set(error, ZIP_ER_INCONS, 0);
return NULL;
}
Expand Down

0 comments on commit 9b46957

Please sign in to comment.