Skip to content

Commit 08d20c7

Browse files
[AUTO-CHERRYPICK] Patch giflib for CVE-2021-40633 [High] - branch main (#13537)
Co-authored-by: Kanishk Bansal <103916909+Kanishk-Bansal@users.noreply.github.com>
1 parent 4249a35 commit 08d20c7

2 files changed

Lines changed: 35 additions & 1 deletion

File tree

SPECS/giflib/CVE-2021-40633.patch

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
From 7e6036db1536e0972de6f8f4e1fcf827d313f8ea Mon Sep 17 00:00:00 2001
2+
From: Kanishk-Bansal <kbkanishk975@gmail.com>
3+
Date: Mon, 21 Apr 2025 19:53:54 +0000
4+
Subject: [PATCH] Address CVE-2021-40633
5+
6+
Upstream Patch Reference : https://sourceforge.net/p/giflib/code/ci/ccbc956432650734c91acb3fc88837f7b81267ff
7+
8+
Signed-off-by: Kanishk-Bansal <kbkanishk975@gmail.com>
9+
---
10+
gif2rgb.c | 4 ++++
11+
1 file changed, 4 insertions(+)
12+
13+
diff --git a/gif2rgb.c b/gif2rgb.c
14+
index 11c39e4..855f821 100644
15+
--- a/gif2rgb.c
16+
+++ b/gif2rgb.c
17+
@@ -496,6 +496,10 @@ static void GIF2RGB(int NumFiles, char *FileName,
18+
ScreenBuffer,
19+
GifFile->SWidth, GifFile->SHeight);
20+
21+
+ for (i = 0; i < GifFile->SHeight; i++) {
22+
+ (void)free(ScreenBuffer[i]);
23+
+ }
24+
+
25+
(void)free(ScreenBuffer);
26+
27+
if (DGifCloseFile(GifFile, &Error) == GIF_ERROR) {
28+
--
29+
2.45.2
30+

SPECS/giflib/giflib.spec

Lines changed: 5 additions & 1 deletion
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: 9%{?dist}
4+
Release: 10%{?dist}
55
License: MIT
66
Vendor: Microsoft Corporation
77
Distribution: Mariner
@@ -13,6 +13,7 @@ Patch1: CVE-2023-48161.patch
1313
Patch2: CVE-2022-28506.patch
1414
Patch3: CVE-2023-39742.patch
1515
Patch4: CVE-2025-31344.patch
16+
Patch5: CVE-2021-40633.patch
1617
BuildRequires: gcc
1718
BuildRequires: make
1819
BuildRequires: xmlto
@@ -63,6 +64,9 @@ find %{buildroot} -name '*.a' -print -delete
6364
%{_mandir}/man1/*.1*
6465

6566
%changelog
67+
* Mon Apr 21 2025 Kanishk Bansal <kanbansal@microsoft.com> - 5.2.1-10
68+
- Patch CVE-2021-40633 using an upstream patch
69+
6670
* Tue Apr 15 2025 Sudipta Pandit <sudpandit@microsoft.com> - 5.2.1-9
6771
- Patch CVE-2025-31344
6872

0 commit comments

Comments
 (0)