Skip to content

Commit d944fbb

Browse files
authored
[Medium] Patch iniparser for CVE-2023-33461 (#13804)
Signed-off-by: Sreenivasulu Malavathula <v-smalavathu@microsoft.com>
1 parent 837e7d7 commit d944fbb

File tree

2 files changed

+49
-1
lines changed

2 files changed

+49
-1
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
From 29d59278577f9a4dcf547cedd383d8af6dafca87 Mon Sep 17 00:00:00 2001
2+
From: Sreenivasulu Malavathula <v-smalavathu@microsoft.com>
3+
Date: Wed, 14 May 2025 18:59:49 -0500
4+
Subject: [PATCH] Address CVE-2023-33461
5+
Upstream Patch Reference: https://src.fedoraproject.org/rpms/iniparser/blob/f38/f/iniparser-4.1-CVE-2023-33461.patch
6+
7+
---
8+
src/iniparser.c | 6 +++---
9+
1 file changed, 3 insertions(+), 3 deletions(-)
10+
11+
diff --git a/src/iniparser.c b/src/iniparser.c
12+
index 62febeb..11ec902 100644
13+
--- a/src/iniparser.c
14+
+++ b/src/iniparser.c
15+
@@ -457,7 +457,7 @@ long int iniparser_getlongint(const dictionary * d, const char * key, long int n
16+
const char * str ;
17+
18+
str = iniparser_getstring(d, key, INI_INVALID_KEY);
19+
- if (str==INI_INVALID_KEY) return notfound ;
20+
+ if (str==NULL || str==INI_INVALID_KEY) return notfound ;
21+
return strtol(str, NULL, 0);
22+
}
23+
24+
@@ -512,7 +512,7 @@ double iniparser_getdouble(const dictionary * d, const char * key, double notfou
25+
const char * str ;
26+
27+
str = iniparser_getstring(d, key, INI_INVALID_KEY);
28+
- if (str==INI_INVALID_KEY) return notfound ;
29+
+ if (str==NULL || str==INI_INVALID_KEY) return notfound ;
30+
return atof(str);
31+
}
32+
33+
@@ -554,7 +554,7 @@ int iniparser_getboolean(const dictionary * d, const char * key, int notfound)
34+
const char * c ;
35+
36+
c = iniparser_getstring(d, key, INI_INVALID_KEY);
37+
- if (c==INI_INVALID_KEY) return notfound ;
38+
+ if (c==NULL || c==INI_INVALID_KEY) return notfound ;
39+
if (c[0]=='y' || c[0]=='Y' || c[0]=='1' || c[0]=='t' || c[0]=='T') {
40+
ret = 1 ;
41+
} else if (c[0]=='n' || c[0]=='N' || c[0]=='0' || c[0]=='f' || c[0]=='F') {
42+
--
43+
2.45.2
44+

SPECS/iniparser/iniparser.spec

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@ Distribution: Azure Linux
55

66
Name: iniparser
77
Version: 4.1
8-
Release: 8%{?dist}
8+
Release: 9%{?dist}
99
Summary: C library for parsing "INI-style" files
1010

1111
License: MIT
1212
URL: https://github.com/ndevilla/%{name}
1313
Source0: https://github.com/ndevilla/%{name}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
1414
Patch0: CVE-2025-0633.patch
15+
Patch1: CVE-2023-33461.patch
1516

1617
BuildRequires: gcc
1718

@@ -72,6 +73,9 @@ make check
7273
%{_includedir}/*.h
7374

7475
%changelog
76+
* Wed May 14 2025 Sreeniavsulu Malavathula <v-smalavathu@microsoft.com> - 4.1.9
77+
- Patch CVE-2023-33461
78+
7579
* Tue Feb 25 2025 Mayank Singh <mayansingh@microsoft.com> - 4.1.8
7680
- Fix CVE-2025-0633 with an upstream patch
7781

0 commit comments

Comments
 (0)