johannes Mon, 16 May 2011 22:24:41 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=311112
Log:
- Handle error if tempfile can't be opened, found by parfait
Changed paths:
U php/php-src/branches/PHP_5_3/ext/phar/zip.c
U php/php-src/branches/PHP_5_4/ext/phar/zip.c
U php/php-src/trunk/ext/phar/zip.c
Modified: php/php-src/branches/PHP_5_3/ext/phar/zip.c
===================================================================
--- php/php-src/branches/PHP_5_3/ext/phar/zip.c 2011-05-16 22:15:36 UTC (rev
311111)
+++ php/php-src/branches/PHP_5_3/ext/phar/zip.c 2011-05-16 22:24:41 UTC (rev
311112)
@@ -411,6 +411,9 @@
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 */
Modified: php/php-src/branches/PHP_5_4/ext/phar/zip.c
===================================================================
--- php/php-src/branches/PHP_5_4/ext/phar/zip.c 2011-05-16 22:15:36 UTC (rev
311111)
+++ php/php-src/branches/PHP_5_4/ext/phar/zip.c 2011-05-16 22:24:41 UTC (rev
311112)
@@ -411,6 +411,9 @@
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 */
Modified: php/php-src/trunk/ext/phar/zip.c
===================================================================
--- php/php-src/trunk/ext/phar/zip.c 2011-05-16 22:15:36 UTC (rev 311111)
+++ php/php-src/trunk/ext/phar/zip.c 2011-05-16 22:24:41 UTC (rev 311112)
@@ -411,6 +411,9 @@
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 */
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php