diff options
author | Remi Collet <remi@php.net> | 2013-12-30 07:35:30 +0100 |
---|---|---|
committer | Remi Collet <remi@php.net> | 2013-12-30 07:35:30 +0100 |
commit | 0a950a05005f94e56bd2a42b99a0961db86952db (patch) | |
tree | 3949553a3f889947795b007df4776643b153da55 /ext/zip/lib/zip_open.c | |
parent | 5a756afcf14fada75f6ed8052cd97924dd229ed8 (diff) | |
download | php-git-0a950a05005f94e56bd2a42b99a0961db86952db.tar.gz |
Sync with pecl/zip 1.12.4dev
- update bunled libzip to 0.11.2
- expose zip_file_set_external_attributes + zip_file_get_external_attributes
with new methods:
ZipArchive::setExternalAttributesName
ZipArchive::setExternalAttributesIndex
ZipArchive::getExternalAttributesName
ZipArchive::getExternalAttributesIndex
Diffstat (limited to 'ext/zip/lib/zip_open.c')
-rw-r--r-- | ext/zip/lib/zip_open.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/ext/zip/lib/zip_open.c b/ext/zip/lib/zip_open.c index e6a30d5ae7..d91fe469db 100644 --- a/ext/zip/lib/zip_open.c +++ b/ext/zip/lib/zip_open.c @@ -364,7 +364,7 @@ _zip_checkcons(FILE *fp, struct zip_cdir *cd, struct zip_error *error) /* _zip_check_torrentzip: - check wether ZA has a valid TORRENTZIP comment, i.e. is torrentzipped */ + check whether ZA has a valid TORRENTZIP comment, i.e. is torrentzipped */ static void _zip_check_torrentzip(struct zip *za, const struct zip_cdir *cdir) @@ -498,6 +498,11 @@ _zip_find_central_dir(FILE *fp, unsigned int flags, int *zep, off_t len) zip_int64_t best; struct zip_error zerr; + if (len < (off_t)EOCDLEN) { + set_error(zep, NULL, ZIP_ER_NOZIP); + return NULL; + } + i = fseeko(fp, -(len < CDBUFSIZE ? len : CDBUFSIZE), SEEK_END); if (i == -1 && errno != EFBIG) { /* seek before start of file on my machine */ |