diff options
author | Pierre Joye <pierre.php@gmail.com> | 2013-05-14 16:46:32 +0200 |
---|---|---|
committer | Pierre Joye <pierre.php@gmail.com> | 2013-05-14 16:46:32 +0200 |
commit | 42a186e22d6621dfb606fa2e562140faa08e8c99 (patch) | |
tree | a3143f471a8a771336ece9c76e469698fc9269fd /ext/phar/util.c | |
parent | 362402d7484725287b5eae23936b09e570d83d48 (diff) | |
parent | 7ec2e5314eb62d9cd2ef23e0b62445eb50cc23c0 (diff) | |
download | php-git-42a186e22d6621dfb606fa2e562140faa08e8c99.tar.gz |
Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
more check for php_stream_fopen_tmpfile failure
Diffstat (limited to 'ext/phar/util.c')
-rw-r--r-- | ext/phar/util.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/ext/phar/util.c b/ext/phar/util.c index 05c90cd458..898d8bd4b2 100644 --- a/ext/phar/util.c +++ b/ext/phar/util.c @@ -889,6 +889,10 @@ int phar_copy_entry_fp(phar_entry_info *source, phar_entry_info *dest, char **er dest->offset = 0; dest->is_modified = 1; dest->fp = php_stream_fopen_tmpfile(); + if (dest->fp == NULL) { + spprintf(error, 0, "phar error: unable to create temporary file"); + return EOF; + } phar_seek_efp(source, 0, SEEK_SET, 0, 1 TSRMLS_CC); link = phar_get_link_source(source TSRMLS_CC); @@ -1129,6 +1133,10 @@ int phar_separate_entry_fp(phar_entry_info *entry, char **error TSRMLS_DC) /* {{ } fp = php_stream_fopen_tmpfile(); + if (fp == NULL) { + spprintf(error, 0, "phar error: unable to create temporary file"); + return FAILURE; + } phar_seek_efp(entry, 0, SEEK_SET, 0, 1 TSRMLS_CC); link = phar_get_link_source(entry TSRMLS_CC); |