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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user