php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #80366
Patch iptc_fix.patch revision 2020-11-13 19:32 UTC by sagpant at microsoft dot com
Patch iptc.patch revision 2020-11-13 19:12 UTC by sagpant at microsoft dot com

Patch iptc_fix.patch for GetImageSize related Bug #80366

Patch version 2020-11-13 19:32 UTC

Return to Bug #80366 | Download this patch
Patch Revisions:

Developer: sagpant@microsoft.com

diff --git a/ext/standard/iptc.c b/ext/standard/iptc.c
index f3c17dadd9..41d6645831 100644
--- a/ext/standard/iptc.c
+++ b/ext/standard/iptc.c
@@ -216,9 +216,7 @@ PHP_FUNCTION(iptcembed)
 		RETURN_FALSE;
 	}
 
-	if (spool < 2) {
-		zend_fstat(fileno(fp), &sb);
-
+	if (spool < 2 && zend_fstat(fileno(fp), &sb) == 0) {
 		spoolbuf = zend_string_safe_alloc(1, iptcdata_len + sizeof(psheader) + 1024 + 1, sb.st_size, 0);
 		poi = (unsigned char*)ZSTR_VAL(spoolbuf);
 		memset(poi, 0, iptcdata_len + sizeof(psheader) + sb.st_size + 1024 + 1);
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 05:01:33 2024 UTC