[php-src] PHP-8.4.24: libgd patch for CVE-2026-9672

Ilija Tovilo <[email protected]> Wed, 29 Jul 2026 05:23:20 +0000
Newsgroups gmane.comp.php.cvs.general
Message-ID <[email protected]>
Author: Ilija Tovilo (iluuu1994)
Pusher: NattyNarwhal
Date: 2026-07-28T02:58:34+02:00

Commit: https://github.com/php/php-src/commit/b590f0380fda26ed180874a0255f0be078434315
Raw diff: https://github.com/php/php-src/commit/b590f0380fda26ed180874a0255f0be078434315.diff

libgd patch for CVE-2026-9672

Patch by Pierre Joye (pierrejoye).

Changed paths:
  M  ext/gd/libgd/gd_gif_in.c


Diff:

diff --git a/ext/gd/libgd/gd_gif_in.c b/ext/gd/libgd/gd_gif_in.c
index 0204c4158db4..14c27f3293cc 100644
--- a/ext/gd/libgd/gd_gif_in.c
+++ b/ext/gd/libgd/gd_gif_in.c
@@ -452,7 +452,7 @@ LWZReadByte_(gdIOCtx *fd, LZW_STATIC_DATA *sd, char flag, int input_code_size, i
 			sd->table[1][i] = i;
 		}
 		for (; i < (1<<MAX_LWZ_BITS); ++i)
-			sd->table[0][i] = sd->table[1][0] = 0;
+			sd->table[0][i] = sd->table[1][i] = 0;
 
 		sd->sp = sd->stack;
 
@@ -496,6 +496,8 @@ LWZReadByte_(gdIOCtx *fd, LZW_STATIC_DATA *sd, char flag, int input_code_size, i
 
 			if (count != 0)
 				return -2;
+
+			return -2;
 		}
 
 		incode = code;
@@ -562,7 +564,7 @@ ReadImage(gdImagePtr im, gdIOCtx *fd, int len, int height, unsigned char (*cmap)
 	int             v;
 	int             xpos = 0, ypos = 0, pass = 0;
 	int i;
-	LZW_STATIC_DATA sd;
+	LZW_STATIC_DATA sd = {0};
 
 
 	/*