com php-src: improve fix: ext/standard/image.c
| From: | Anatol Belski | Date: | Fri, 02 Sep 2016 21:33:43 +0000 |
| Subject: | com php-src: improve fix: ext/standard/image.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-94264@lists.php.net to get a copy of this message | ||
Commit: e4564e4b985cc9cf4e53eca3152b869843247cf2
Author: Anatol Belski <ab@php.net> Fri, 2 Sep 2016 23:33:43 +0200
Parents: 93bb7794332631193e37ade68141c3c39f80c355
Branches: PHP-7.1 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=e4564e4b985cc9cf4e53eca3152b869843247cf2
Log:
improve fix
Changed paths:
M ext/standard/image.c
Diff:
diff --git a/ext/standard/image.c b/ext/standard/image.c
index c5616d1..480246a 100644
--- a/ext/standard/image.c
+++ b/ext/standard/image.c
@@ -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)) {