1
0
mirror of https://github.com/php/php-src.git synced 2026-03-30 04:02:19 +02:00

improve fix

This commit is contained in:
Anatol Belski
2016-09-02 23:33:43 +02:00
parent 93bb779433
commit e4564e4b98

View File

@@ -207,18 +207,16 @@ static struct gfxinfo *php_handle_swc(php_stream * stream)
unsigned char *b, *buf = NULL;
zend_string *bufz;
b = ecalloc(1, len + 1);
if (php_stream_seek(stream, 5, SEEK_CUR)) {
efree(b);
return NULL;
}
if (php_stream_read(stream, (char *) a, sizeof(a)) != sizeof(a)) {
efree(b);
return NULL;
}
b = ecalloc(1, len + 1);
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)) {