diff options
| author | Remi Collet <remi@php.net> | 2013-12-30 07:38:45 +0100 |
|---|---|---|
| committer | Remi Collet <remi@php.net> | 2013-12-30 07:38:45 +0100 |
| commit | 764190c1d6ccf3d4ae2cc54aacb465ccff49d9cc (patch) | |
| tree | 2f5c62c9c4220c744eb3de86efb306cf71639e54 /ext/zip/lib/zip_open.c | |
| parent | 6b343434796f82ba6cb829f981c8ce68a82bb52c (diff) | |
| parent | 0a950a05005f94e56bd2a42b99a0961db86952db (diff) | |
| download | php-git-764190c1d6ccf3d4ae2cc54aacb465ccff49d9cc.tar.gz | |
Merge branch 'PHP-5.6'
* PHP-5.6:
Sync with pecl/zip 1.12.4dev
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 */ |
