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

Ilija Tovilo <[email protected]> Tue, 28 Jul 2026 17:56:58 +0000
Newsgroups gmane.comp.php.cvs.general
Message-ID <[email protected]>
Author: Ilija Tovilo (iluuu1994)
Pusher: ericmann
Date: 2026-07-28T02:57:55+02:00

Commit: https://github.com/php/php-src/commit/f7b43bf6a6b34d8e65f952a9197438f030955a1a
Raw diff: https://github.com/php/php-src/commit/f7b43bf6a6b34d8e65f952a9197438f030955a1a.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 1f697236107f..e055f9024455 100644
--- a/ext/gd/libgd/gd_gif_in.c
+++ b/ext/gd/libgd/gd_gif_in.c
@@ -450,7 +450,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;
 
@@ -494,6 +494,8 @@ LWZReadByte_(gdIOCtx *fd, LZW_STATIC_DATA *sd, char flag, int input_code_size, i
 
 			if (count != 0)
 				return -2;
+
+			return -2;
 		}
 
 		incode = code;
@@ -560,7 +562,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};
 
 
 	/*