com php-src: fix possible NULL deref in image functions: ext/standard/image.c

From: Date: Sun, 08 Nov 2015 03:23:26 +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-89690@lists.php.net to get a copy of this message
Commit: 7f3ba1fe6fbd4df2ac243af6453920eaa80184c3 Author: Anatol Belski <ab@php.net> Thu, 5 Nov 2015 18:16:32 +0100 Parents: 352117b728cd3edb8b79c7ec4e45ae060224b6ad Branches: PHP-7.0.0 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=7f3ba1fe6fbd4df2ac243af6453920eaa80184c3 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

« previous php.cvs (#89690) next »