Commit:    533e636a62a1f1d5119f262f44c48097d7762735
Author:    Pierre Joye <pierre....@gmail.com>         Tue, 14 May 2013 09:20:53 
+0200
Parents:   fe21accfb4913bf309f26894ae27e9ad34fb5260
Branches:  PHP-5.3 PHP-5.4 PHP-5.5 master

Link:       
http://git.php.net/?p=php-src.git;a=commitdiff;h=533e636a62a1f1d5119f262f44c48097d7762735

Log:
php_stream_fopen_tmpfile may file, causing any following stream usage to crash

Changed paths:
  M  ext/phar/zip.c


Diff:
diff --git a/ext/phar/zip.c b/ext/phar/zip.c
index 33732fb..2d57c08 100644
--- a/ext/phar/zip.c
+++ b/ext/phar/zip.c
@@ -1122,6 +1122,10 @@ static int phar_zip_applysignature(phar_archive_data 
*phar, struct _phar_zip_pas
                entry.fp = php_stream_fopen_tmpfile();
                entry.fp_type = PHAR_MOD;
                entry.is_modified = 1;
+               if (entry.fp == NULL) {
+                       spprintf(pass->error, 0, "phar error: unable to create 
temporary file for signature");
+                       return FAILURE;
+               }
 
                PHAR_SET_32(sigbuf, phar->sig_flags);
                PHAR_SET_32(sigbuf + 4, signature_length);


--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to