php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #74910
Patch swc-len-fix-php7.0 revision 2017-07-12 12:54 UTC by adam dot rosadzinski at home dot net dot pl
Patch swc-len-fix revision 2017-07-12 12:17 UTC by adam dot rosadzinski at home dot net dot pl

Patch swc-len-fix for GetImageSize related Bug #74910

Patch version 2017-07-12 12:17 UTC

Return to Bug #74910 | Download this patch
This patch is obsolete

Obsoleted by patches:

Patch Revisions:

Developer: adam.rosadzinski@home.net.pl

--- a/ext/standard/image.c	2017-07-12 14:02:13.000000000 +0200
+++ b/ext/standard/image.c	2017-05-09 13:41:03.000000000 +0200
@@ -201,7 +201,7 @@ static struct gfxinfo *php_handle_swc(ph
 
 	long bits;
 	unsigned char a[64];
+	unsigned long len = 64, szlength = 0;
-	unsigned long len=64, szlength;
 	int factor = 1,maxfactor = 16;
 	int status = 0;
 	unsigned char *b, *buf = NULL;
@@ -215,7 +215,7 @@ static struct gfxinfo *php_handle_swc(ph
 	if (php_stream_read(stream, (char *) a, sizeof(a)) != sizeof(a))
 		return NULL;
 
+	if (uncompress(b, &szlength, a, sizeof(a)) != Z_OK) {
-	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)) {
 			return NULL;
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Sun Sep 27 20:01:23 2020 UTC