diff --git a/ext/zip/php_zip.c b/ext/zip/php_zip.c index 803543029da..d4115f8c189 100644 --- a/ext/zip/php_zip.c +++ b/ext/zip/php_zip.c @@ -2668,7 +2668,7 @@ static ZIPARCHIVE_METHOD(extractTo) for (i = 0; i < filecount; i++) { char *file = (char*)zip_get_name(intern, i, ZIP_FL_UNCHANGED); - if (!php_zip_extract_file(intern, pathto, file, strlen(file))) { + if (!file || !php_zip_extract_file(intern, pathto, file, strlen(file))) { RETURN_FALSE; } }