Skip to content

Commit 6203c53

Browse files
[AutoPR- Security] Patch giflib for CVE-2026-23868 [HIGH] (#16180)
Co-authored-by: Kanishk Bansal <103916909+Kanishk-Bansal@users.noreply.github.com>
1 parent e81ae75 commit 6203c53

2 files changed

Lines changed: 39 additions & 2 deletions

File tree

SPECS/giflib/CVE-2026-23868.patch

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
From 56172b0dcdf87cba6fca712cb3e4db248195dcbd Mon Sep 17 00:00:00 2001
2+
From: "Eric S. Raymond" <esr@thyrsus.com>
3+
Date: Wed, 4 Mar 2026 18:49:49 -0500
4+
Subject: [PATCH] Avoid potentuial double-free on weird images.
5+
6+
Signed-off-by: Azure Linux Security Servicing Account <azurelinux-security@microsoft.com>
7+
Upstream-reference: https://raw.githubusercontent.com/Kanishk-Bansal/CVE-Patches/refs/heads/main/0001-Avoid-potentuial-double-free-on-weird-images.patch
8+
---
9+
gifalloc.c | 8 ++++++++
10+
1 file changed, 8 insertions(+)
11+
12+
diff --git a/gifalloc.c b/gifalloc.c
13+
index 9cac7e4..4f87bd3 100644
14+
--- a/gifalloc.c
15+
+++ b/gifalloc.c
16+
@@ -348,6 +348,14 @@ GifMakeSavedImage(GifFileType *GifFile, const SavedImage *CopyFrom)
17+
* problems.
18+
*/
19+
20+
+ /* Null out aliased pointers before any allocations
21+
+ * so that FreeLastSavedImage won't free CopyFrom's
22+
+ * data if an allocation fails partway through. */
23+
+ sp->ImageDesc.ColorMap = NULL;
24+
+ sp->RasterBits = NULL;
25+
+ sp->ExtensionBlocks = NULL;
26+
+ sp->ExtensionBlockCount = 0;
27+
+
28+
/* first, the local color map */
29+
if (CopyFrom->ImageDesc.ColorMap != NULL) {
30+
sp->ImageDesc.ColorMap = GifMakeMapObject(
31+
--
32+
2.45.4
33+

SPECS/giflib/giflib.spec

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Name: giflib
22
Summary: A library and utilities for processing GIFs
33
Version: 5.2.1
4-
Release: 10%{?dist}
4+
Release: 11%{?dist}
55
License: MIT
66
Vendor: Microsoft Corporation
77
Distribution: Mariner
@@ -14,6 +14,7 @@ Patch2: CVE-2022-28506.patch
1414
Patch3: CVE-2023-39742.patch
1515
Patch4: CVE-2025-31344.patch
1616
Patch5: CVE-2021-40633.patch
17+
Patch6: CVE-2026-23868.patch
1718
BuildRequires: gcc
1819
BuildRequires: make
1920
BuildRequires: xmlto
@@ -64,13 +65,16 @@ find %{buildroot} -name '*.a' -print -delete
6465
%{_mandir}/man1/*.1*
6566

6667
%changelog
68+
* Thu Mar 12 2026 Azure Linux Security Servicing Account <azurelinux-security@microsoft.com> - 5.2.1-11
69+
- Patch for CVE-2026-23868
70+
6771
* Mon Apr 21 2025 Kanishk Bansal <kanbansal@microsoft.com> - 5.2.1-10
6872
- Patch CVE-2021-40633 using an upstream patch
6973

7074
* Tue Apr 15 2025 Sudipta Pandit <sudpandit@microsoft.com> - 5.2.1-9
7175
- Patch CVE-2025-31344
7276

73-
* Fri Feb 14 2024 Kevin Lockwood <v-klockwood@microsoft.com> - 5.2.1-8
77+
* Fri Feb 14 2025 Kevin Lockwood <v-klockwood@microsoft.com> - 5.2.1-8
7478
- Patch CVE-2023-39742
7579

7680
* Fri Oct 11 2024 Suresh Thelkar <sthelkar@microsoft.com> - 5.2.1-7

0 commit comments

Comments
 (0)