diff options
author | Pierre Joye <pierre.php@gmail.com> | 2013-05-14 09:21:30 +0200 |
---|---|---|
committer | Pierre Joye <pierre.php@gmail.com> | 2013-05-14 09:21:30 +0200 |
commit | 362402d7484725287b5eae23936b09e570d83d48 (patch) | |
tree | a063dca6c09891cf85ff53bad3eb5de5fa129bfa | |
parent | e191cb63ba9a32c527263b3913e2f4e5d6dd8aa3 (diff) | |
parent | f37c54ab276bc55339e4b8aa2b6f5caa88cb4b86 (diff) | |
download | php-git-362402d7484725287b5eae23936b09e570d83d48.tar.gz |
Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
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); |