diff options
author | Anatoliy Belsky <ab@php.net> | 2012-06-17 16:04:36 +0200 |
---|---|---|
committer | Anatoliy Belsky <ab@php.net> | 2012-06-17 16:04:36 +0200 |
commit | d3780f1f903e6cee4bb2ff723aa36a5cd1824c08 (patch) | |
tree | 4b4303f4f52708ad6dc1d59e4720500f3ce0e197 /ext/zip/lib/zip_open.c | |
parent | 26cb5706155347815cec5b2fb5af968e31fd55e3 (diff) | |
download | php-git-d3780f1f903e6cee4bb2ff723aa36a5cd1824c08.tar.gz |
Reverted the BC fix regarding to #57905, test adopted
New 0.10.1 has a stronger archive integrity check. Restoring
the old behaviour of libzip < 0.10.1 makes no sense at this
place.
Diffstat (limited to 'ext/zip/lib/zip_open.c')
-rw-r--r-- | ext/zip/lib/zip_open.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/ext/zip/lib/zip_open.c b/ext/zip/lib/zip_open.c index a348d9800d..2f56881b0a 100644 --- a/ext/zip/lib/zip_open.c +++ b/ext/zip/lib/zip_open.c @@ -206,9 +206,7 @@ _zip_readcdir(FILE *fp, off_t buf_offset, unsigned char *buf, unsigned char *eoc cd->comment = NULL; cd->comment_len = _zip_read2(&cdp); - /* without checking the ZIP_CHECKCONS flag we'll not able even to open inconsistent - archives at this place, which would break bc in PHP */ - if ((ZIP_CHECKCONS == (flags & ZIP_CHECKCONS)) && ((zip_uint64_t)cd->offset)+cd->size > buf_offset + (eocd-buf)) { + if (((zip_uint64_t)cd->offset)+cd->size > buf_offset + (eocd-buf)) { /* cdir spans past EOCD record */ _zip_error_set(error, ZIP_ER_INCONS, 0); cd->nentry = 0; @@ -239,13 +237,7 @@ _zip_readcdir(FILE *fp, off_t buf_offset, unsigned char *buf, unsigned char *eoc } } - /* the first if branch goes the old way of libzip 0.9 so we don't loose - the bc for reading inconsistent files */ - if ((ZIP_CHECKCONS != (flags & ZIP_CHECKCONS)) && cd->size < (unsigned int)(eocd-buf)) { - cdp = eocd - cd->size; - bufp = &cdp; - } - else if (cd->offset >= buf_offset) { + if (cd->offset >= buf_offset) { /* if buffer already read in, use it */ cdp = buf + (cd->offset - buf_offset); bufp = &cdp; |