com php-src: fix possible NULL deref in image functions: ext/standard/image.c
| From: | Anatol Belski | Date: | Thu, 05 Nov 2015 17:16:32 +0000 |
| Subject: | com php-src: fix possible NULL deref in image functions: ext/standard/image.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-89600@lists.php.net to get a copy of this message | ||
Commit: f189353178bd8e88bee9590669dfd0c53b784b28
Author: Anatol Belski <ab@php.net> Thu, 5 Nov 2015 18:16:32 +0100
Parents: 5ac288bcc6b8858e3ea509d92426b2bacc7fd397
Branches: PHP-7.0 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=f189353178bd8e88bee9590669dfd0c53b784b28
Log:
fix possible NULL deref in image functions
Changed paths:
M ext/standard/image.c
Diff:
diff --git a/ext/standard/image.c b/ext/standard/image.c
index 3784239..7f100d6 100644
--- a/ext/standard/image.c
+++ b/ext/standard/image.c
@@ -217,11 +217,16 @@ static struct gfxinfo *php_handle_swc(php_stream * stream)
if (uncompress(b, &len, a, sizeof(a)) != Z_OK) {
/* failed to decompress the file, will try reading the rest of the file */
- if (php_stream_seek(stream, 8, SEEK_SET))
+ if (php_stream_seek(stream, 8, SEEK_SET)) {
return NULL;
+ }
bufz = php_stream_copy_to_mem(stream, PHP_STREAM_COPY_ALL, 0);
+ if (!bufz) {
+ return NULL;
+ }
+
/*
* zlib::uncompress() wants to know the output data length
* if none was given as a parameter