Skip to content

Commit

Permalink
Backport and apply upstream patch for CVE-2017-14107
Browse files Browse the repository at this point in the history
  • Loading branch information
weltling committed Oct 27, 2017
1 parent f600785 commit f6e8ce8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ext/zip/lib/zip_open.c
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,12 @@ _zip_read_eocd64(FILE *f, const zip_uint8_t *eocd64loc, const zip_uint8_t *buf,
_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 f6e8ce8

Please sign in to comment.