From: Johannes Schlüter Date: Mon, 16 May 2011 22:24:41 +0000 (+0000) Subject: - Handle error if tempfile can't be opened, found by parfait X-Git-Tag: php-5.5.0alpha1~2087 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=103ded60c0243d73f86ac82d62ec81d8dd9e3778;p=php - Handle error if tempfile can't be opened, found by parfait --- diff --git a/ext/phar/zip.c b/ext/phar/zip.c index fa3642f5c7..a8ac63aeb2 100644 --- a/ext/phar/zip.c +++ b/ext/phar/zip.c @@ -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 */