Skip to content

Commit 146939e

Browse files
[AUTO-CHERRYPICK] Patch giflib for CVE-2025-31344 [HIGH] - branch main (#13489)
Co-authored-by: Sudipta Pandit <sudpandit@microsoft.com>
1 parent 72ede32 commit 146939e

2 files changed

Lines changed: 34 additions & 1 deletion

File tree

SPECS/giflib/CVE-2025-31344.patch

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
From a4f400bf6fc39436d21ea9ca30d299ae44988a6d Mon Sep 17 00:00:00 2001
2+
From: Sudipta Pandit <sudpandit@microsoft.com>
3+
Date: Wed, 16 Apr 2025 03:03:51 +0530
4+
Subject: [PATCH] Fix CVE-2025-31344
5+
6+
Upstream ref: https://gitee.com/src-openeuler/giflib/blob/2c10c1abf8ff2e88b1da04e050bb721487b73fa3/Fix-heap-buffer-overflow.patch
7+
8+
---
9+
gif2rgb.c | 4 ++++
10+
1 file changed, 4 insertions(+)
11+
12+
diff --git a/gif2rgb.c b/gif2rgb.c
13+
index 8d7c0ff..2032604 100644
14+
--- a/gif2rgb.c
15+
+++ b/gif2rgb.c
16+
@@ -317,6 +317,10 @@ static void DumpScreen2RGB(char *FileName, int OneFileFlag,
17+
GifRow = ScreenBuffer[i];
18+
GifQprintf("\b\b\b\b%-4d", ScreenHeight - i);
19+
for (j = 0; j < ScreenWidth; j++) {
20+
+ /* Check if color is within color palate */
21+
+ if (GifRow[j] >= ColorMap->ColorCount) {
22+
+ GIF_EXIT(GifErrorString(D_GIF_ERR_IMAGE_DEFECT));
23+
+ }
24+
ColorMapEntry = &ColorMap->Colors[GifRow[j]];
25+
Buffers[0][j] = ColorMapEntry->Red;
26+
Buffers[1][j] = ColorMapEntry->Green;
27+
--
28+
2.34.1
29+

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: 8%{?dist}
4+
Release: 9%{?dist}
55
License: MIT
66
Vendor: Microsoft Corporation
77
Distribution: Mariner
@@ -12,6 +12,7 @@ Patch0: giflib_quantize.patch
1212
Patch1: CVE-2023-48161.patch
1313
Patch2: CVE-2022-28506.patch
1414
Patch3: CVE-2023-39742.patch
15+
Patch4: CVE-2025-31344.patch
1516
BuildRequires: gcc
1617
BuildRequires: make
1718
BuildRequires: xmlto
@@ -62,6 +63,9 @@ find %{buildroot} -name '*.a' -print -delete
6263
%{_mandir}/man1/*.1*
6364

6465
%changelog
66+
* Tue Apr 15 2025 Sudipta Pandit <sudpandit@microsoft.com> - 5.2.1-9
67+
- Patch CVE-2025-31344
68+
6569
* Fri Feb 14 2024 Kevin Lockwood <v-klockwood@microsoft.com> - 5.2.1-8
6670
- Patch CVE-2023-39742
6771

0 commit comments

Comments
 (0)