1
0
mirror of https://github.com/php/php-src.git synced 2026-04-27 01:48:26 +02:00

fix possible NULL deref in image functions

This commit is contained in:
Anatol Belski
2015-11-05 18:16:32 +01:00
parent 5ac288bcc6
commit f189353178
+6 -1
View File
@@ -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