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-php7.0 for GetImageSize related Bug #74910

Patch version 2017-07-12 12:54 UTC

Return to Bug #74910 | Download this patch
This patch renders other patches obsolete

Obsolete patches:

Patch Revisions:

Developer: adam.rosadzinski@home.net.pl

--- a/ext/standard/image.c	2017-05-09 13:41:03.000000000 +0200
+++ b/ext/standard/image.c	2017-07-12 14:05:18.000000000 +0200
@@ -201,7 +201,7 @@ static struct gfxinfo *php_handle_swc(ph
 
 	long bits;
 	unsigned char a[64];
-	unsigned long len=64, szlength;
+	unsigned long len = 64, szlength = 0;
 	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, &len, a, sizeof(a)) != Z_OK) {
+	if (uncompress(b, &szlength, 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-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 05:01:29 2024 UTC