From 86a64f58124d25d44e58ad831a68cf4837526f9f Mon Sep 17 00:00:00 2001 From: pkgagent Date: Fri, 18 Sep 2026 14:36:03 +0800 Subject: [PATCH] =?UTF-8?q?Fix=20CVE-2026-9672:=20GIF=20decoder=20buffer?= =?UTF-8?q?=20overflow=20(uninitialized=20LZW=20table=20/=20improper=20end?= =?UTF-8?q?-of-image=20han=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gd-2.3.3-CVE-2026-9672.patch | 43 ++++++++++++++++++++++++++++++++++++ gd.spec | 8 ++++++- 2 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 gd-2.3.3-CVE-2026-9672.patch diff --git a/gd-2.3.3-CVE-2026-9672.patch b/gd-2.3.3-CVE-2026-9672.patch new file mode 100644 index 0000000..3ff8058 --- /dev/null +++ b/gd-2.3.3-CVE-2026-9672.patch @@ -0,0 +1,43 @@ +From fcd691b377d02285740744bee17c0f298be227d5 Mon Sep 17 00:00:00 2001 +From: Ilija Tovilo +Date: Tue, 28 Jul 2026 02:48:11 +0200 +Subject: [PATCH] libgd patch for CVE-2026-9672 + +Patch by Pierre Joye (pierrejoye). + +Adapted-by: PkgAgent/deepseek-v4 (modified to adapt to opencloudos-stream) +--- + src/gd_gif_in.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/src/gd_gif_in.c b/src/gd_gif_in.c +index 2b6b34e..d57e34b 100644 +--- a/src/gd_gif_in.c ++++ b/src/gd_gif_in.c +@@ -530,7 +530,7 @@ LWZReadByte_(gdIOCtx *fd, LZW_STATIC_DATA *sd, char flag, int input_code_size, 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; +@@ -584,6 +584,8 @@ LWZReadByte_(gdIOCtx *fd, LZW_STATIC_DATA *sd, char flag, int input_code_size, i + if(count != 0) { + return -2; + } ++ ++ return -2; + } + + incode = code; +@@ -664,7 +666,7 @@ ReadImage(gdImagePtr im, gdIOCtx *fd, int len, int height, unsigned char (*cmap) + unsigned char c; + int xpos = 0, ypos = 0, pass = 0; + int v, i; +- LZW_STATIC_DATA sd; ++ LZW_STATIC_DATA sd = {0}; + + /* Initialize the Compression routines */ + if(!ReadOK(fd, &c, 1)) { diff --git a/gd.spec b/gd.spec index c9e6f54..bef207b 100644 --- a/gd.spec +++ b/gd.spec @@ -1,10 +1,11 @@ Summary: A graphics library for quick creation of PNG or JPEG images Name: gd Version: 2.3.3 -Release: 9%{?dist} +Release: 10%{?dist} License: MIT URL: http://libgd.github.io/ Source0: https://github.com/libgd/libgd/releases/download/gd-%{version}/libgd-%{version}.tar.xz +Patch0001: gd-2.3.3-CVE-2026-9672.patch BuildRequires: zlib-devel, pkgconfig, libtool, make BuildRequires: freetype-devel, gettext-devel, fontconfig-devel, liberation-sans-fonts BuildRequires: libjpeg-devel, libpng-devel, libtiff-devel, libwebp-devel, libX11-devel, libXpm-devel @@ -28,6 +29,7 @@ gd. %prep %setup -q -n libgd-%{version} +%patch0001 -p1 %build autoreconf -vif @@ -63,6 +65,10 @@ TMPDIR=/tmp make check %changelog +* Fri Sep 18 2026 PkgAgent Robot - 2.3.3-10 +- [Type] security +- [DESC] Fix CVE-2026-9672: GIF decoder buffer overflow (uninitialized LZW table / improper end-of-image handling) + * Thu Sep 26 2024 OpenCloudOS Release Engineering - 2.3.3-9 - Rebuilt for clarifying the packages requirement in BaseOS and AppStream -- Gitee