Skip to content

Commit c6ae0cf

Browse files
[AUTO-CHERRYPICK] Patch giflib for CVE-2023-39742 in 2.0 - branch main (#12418)
Co-authored-by: Kevin Lockwood <57274670+kevin-b-lockwood@users.noreply.github.com>
1 parent c33c5c0 commit c6ae0cf

2 files changed

Lines changed: 31 additions & 1 deletion

File tree

SPECS/giflib/CVE-2023-39742.patch

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
Description: Fix segmentation faults due to non correct checking for args
2+
Author: David Suárez <david.sephirot@gmail.com>
3+
Origin: vendor
4+
Bug: https://sourceforge.net/p/giflib/bugs/153/
5+
Bug-Debian: https://bugs.debian.org/715963
6+
Bug-Debian: https://bugs.debian.org/715964
7+
Bug-Debian: https://bugs.debian.org/715967
8+
Last-Update: 2020-12-20
9+
10+
Link: https://src.fedoraproject.org/rpms/giflib/raw/4eea5ef82fe65114294d7752ddb2875ebbddffa0/f/fix-get-args-segment-violation.patch
11+
12+
--- a/getarg.c
13+
+++ b/getarg.c
14+
@@ -305,6 +305,12 @@
15+
int i = 0, ScanRes;
16+
17+
while (!(ISSPACE(CtrlStrCopy[i]))) {
18+
+
19+
+ if ((*argv) == argv_end) {
20+
+ GAErrorToken = Option;
21+
+ return CMD_ERR_NumRead;
22+
+ }
23+
+
24+
switch (CtrlStrCopy[i + 1]) {
25+
case 'd': /* Get signed integers. */
26+
ScanRes = sscanf(*((*argv)++), "%d",

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: 7%{?dist}
4+
Release: 8%{?dist}
55
License: MIT
66
Vendor: Microsoft Corporation
77
Distribution: Mariner
@@ -11,6 +11,7 @@ Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.
1111
Patch0: giflib_quantize.patch
1212
Patch1: CVE-2023-48161.patch
1313
Patch2: CVE-2022-28506.patch
14+
Patch3: CVE-2023-39742.patch
1415
BuildRequires: gcc
1516
BuildRequires: make
1617
BuildRequires: xmlto
@@ -61,6 +62,9 @@ find %{buildroot} -name '*.a' -print -delete
6162
%{_mandir}/man1/*.1*
6263

6364
%changelog
65+
* Fri Feb 14 2024 Kevin Lockwood <v-klockwood@microsoft.com> - 5.2.1-8
66+
- Patch CVE-2023-39742
67+
6468
* Fri Oct 11 2024 Suresh Thelkar <sthelkar@microsoft.com> - 5.2.1-7
6569
- Patch CVE-2023-48161 and CVE-2022-28506
6670

0 commit comments

Comments
 (0)