]> granicus.if.org Git - php/commitdiff
Reworked the changes for bug #64452
authorAnatol Belski <ab@php.net>
Sat, 23 Mar 2013 19:57:59 +0000 (20:57 +0100)
committerAnatol Belski <ab@php.net>
Sat, 23 Mar 2013 19:57:59 +0000 (20:57 +0100)
ext/zip/lib/zip_close.c

index e66c56697b14d2ad32e97682d8d3dee1068e42c2..576be3b3536fb68e4d48d742ec7098c7878edd6c 100644 (file)
@@ -88,9 +88,6 @@ zip_close(struct zip *za)
     if (za == NULL)
        return -1;
 
-    if (za->zp == NULL)
-        return -1;
-
     if (!_zip_changed(za, &survivors)) {
        _zip_free(za);
        return 0;
@@ -196,7 +193,7 @@ zip_close(struct zip *za)
        }
        else {
            /* copy existing directory entries */
-           if (fseeko(za->zp, za->cdir->entry[i].offset, SEEK_SET) != 0) {
+           if ((NULL == za->zp) || (fseeko(za->zp, za->cdir->entry[i].offset, SEEK_SET) != 0)) {
                _zip_error_set(&za->error, ZIP_ER_SEEK, errno);
                error = 1;
                break;