diff options
author | Stanislav Malyshev <stas@php.net> | 2011-01-30 22:28:57 +0000 |
---|---|---|
committer | Stanislav Malyshev <stas@php.net> | 2011-01-30 22:28:57 +0000 |
commit | 4a2b458835beb22df12e4398e1b4aa06e4716a8a (patch) | |
tree | f5553284e618f628f9293f0aa30603d597e58434 /ext/zip/lib/zip_name_locate.c | |
parent | 6e57a7792e8143fdf659f597b05e777541afc31f (diff) | |
download | php-git-4a2b458835beb22df12e4398e1b4aa06e4716a8a.tar.gz |
fix bug 53885 (ZipArchive segfault with FL_UNCHANGED on empty archive)
Diffstat (limited to 'ext/zip/lib/zip_name_locate.c')
-rw-r--r-- | ext/zip/lib/zip_name_locate.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/ext/zip/lib/zip_name_locate.c b/ext/zip/lib/zip_name_locate.c index e8b35ff936..96c4f937e0 100644 --- a/ext/zip/lib/zip_name_locate.c +++ b/ext/zip/lib/zip_name_locate.c @@ -60,6 +60,10 @@ _zip_name_locate(struct zip *za, const char *fname, int flags, return -1; } + if((flags & ZIP_FL_UNCHANGED) && !za->cdir) { + return -1; + } + cmp = (flags & ZIP_FL_NOCASE) ? strcmpi : strcmp; n = (flags & ZIP_FL_UNCHANGED) ? za->cdir->nentry : za->nentry; |