diff options
author | Pierre Joye <pierre.php@gmail.com> | 2013-05-14 09:21:17 +0200 |
---|---|---|
committer | Pierre Joye <pierre.php@gmail.com> | 2013-05-14 09:21:17 +0200 |
commit | f37c54ab276bc55339e4b8aa2b6f5caa88cb4b86 (patch) | |
tree | d79c9b2207b24f4b69cf0432b3f868b8f0fb2339 | |
parent | 156576fcced43efc558002d504732271f6cc1fe1 (diff) | |
parent | 533e636a62a1f1d5119f262f44c48097d7762735 (diff) | |
download | php-git-f37c54ab276bc55339e4b8aa2b6f5caa88cb4b86.tar.gz |
Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
php_stream_fopen_tmpfile may file, causing any following stream usage to crash
-rw-r--r-- | ext/phar/zip.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/ext/phar/zip.c b/ext/phar/zip.c index 33732fbd63..2d57c08c5a 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); |