Skip to content

Commit

Permalink
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 f0a42d9 commit 10dc195
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 @@ -837,7 +837,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 10dc195

Please sign in to comment.