]> granicus.if.org Git - php/commitdiff
- Handle error if tempfile can't be opened, found by parfait
authorJohannes Schlüter <johannes@php.net>
Mon, 16 May 2011 22:24:41 +0000 (22:24 +0000)
committerJohannes Schlüter <johannes@php.net>
Mon, 16 May 2011 22:24:41 +0000 (22:24 +0000)
ext/phar/zip.c

index fa3642f5c73ffc0f217005e713eba04c6044b513..a8ac63aeb2a1ba33353a176cbfefc1dfecdd9899 100644 (file)
@@ -411,6 +411,9 @@ foundit:
                        now = php_stream_tell(fp);
                        pefree(entry.filename, entry.is_persistent);
                        sigfile = php_stream_fopen_tmpfile();
+                       if (!sigfile) {
+                               PHAR_ZIP_FAIL("couldn't open temporary file");
+                       }
 
                        php_stream_seek(fp, 0, SEEK_SET);
                        /* copy file contents + local headers and zip comment, if any, to be hashed for signature */