summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSoumya Sambu <soumya.sambu@windriver.com>2024-03-28 12:13:56 +0000
committerArmin Kuster <akuster808@gmail.com>2024-04-28 13:10:23 -0400
commit0fffd4d4221461efd0d0600634af1f5dcbd846e4 (patch)
treed3e73d0b102ca0bf2cbd7074315d9802c771b5ee
parentc0fbf5751a29afef71d7c9b8d3f9bfbe3e199819 (diff)
downloadmeta-openembedded-0fffd4d4221461efd0d0600634af1f5dcbd846e4.tar.gz
iniparser: Fix CVE-2023-33461
iniparser v4.1 is vulnerable to NULL Pointer Dereference in function iniparser_getlongint which misses check NULL for function iniparser_getstring's return. References: https://nvd.nist.gov/vuln/detail/CVE-2023-33461 Signed-off-by: Soumya Sambu <soumya.sambu@windriver.com> Signed-off-by: Armin Kuster <akuster808@gmail.com>
-rw-r--r--meta-oe/recipes-support/iniparser/iniparser/CVE-2023-33461.patch51
-rw-r--r--meta-oe/recipes-support/iniparser/iniparser_4.1.bb4
2 files changed, 54 insertions, 1 deletions
diff --git a/meta-oe/recipes-support/iniparser/iniparser/CVE-2023-33461.patch b/meta-oe/recipes-support/iniparser/iniparser/CVE-2023-33461.patch
new file mode 100644
index 000000000..1b577fa33
--- /dev/null
+++ b/meta-oe/recipes-support/iniparser/iniparser/CVE-2023-33461.patch
@@ -0,0 +1,51 @@
1From ace9871f65d11b5d73f0b9ee8cf5d2807439442d Mon Sep 17 00:00:00 2001
2From: Antonio <antoniolrt@gmail.com>
3Date: Fri, 2 Jun 2023 15:03:10 -0300
4Subject: [PATCH] Handle null return from iniparser_getstring
5
6Fix handling of NULL returns from iniparser_getstring in
7iniparser_getboolean, iniparser_getlongint and iniparser_getdouble,
8avoiding a crash.
9
10CVE: CVE-2023-33461
11
12Upstream-Status: Backport [https://github.com/ndevilla/iniparser/commit/ace9871f65d11b5d73f0b9ee8cf5d2807439442d]
13
14Signed-off-by: Soumya Sambu <soumya.sambu@windriver.com>
15---
16 src/iniparser.c | 6 +++---
17 1 file changed, 3 insertions(+), 3 deletions(-)
18
19diff --git a/src/iniparser.c b/src/iniparser.c
20index f1d1658..dbceb20 100644
21--- a/src/iniparser.c
22+++ b/src/iniparser.c
23@@ -456,7 +456,7 @@ long int iniparser_getlongint(const dictionary * d, const char * key, long int n
24 const char * str ;
25
26 str = iniparser_getstring(d, key, INI_INVALID_KEY);
27- if (str==INI_INVALID_KEY) return notfound ;
28+ if (str==NULL || str==INI_INVALID_KEY) return notfound ;
29 return strtol(str, NULL, 0);
30 }
31
32@@ -511,7 +511,7 @@ double iniparser_getdouble(const dictionary * d, const char * key, double notfou
33 const char * str ;
34
35 str = iniparser_getstring(d, key, INI_INVALID_KEY);
36- if (str==INI_INVALID_KEY) return notfound ;
37+ if (str==NULL || str==INI_INVALID_KEY) return notfound ;
38 return atof(str);
39 }
40
41@@ -553,7 +553,7 @@ int iniparser_getboolean(const dictionary * d, const char * key, int notfound)
42 const char * c ;
43
44 c = iniparser_getstring(d, key, INI_INVALID_KEY);
45- if (c==INI_INVALID_KEY) return notfound ;
46+ if (c==NULL || c==INI_INVALID_KEY) return notfound ;
47 if (c[0]=='y' || c[0]=='Y' || c[0]=='1' || c[0]=='t' || c[0]=='T') {
48 ret = 1 ;
49 } else if (c[0]=='n' || c[0]=='N' || c[0]=='0' || c[0]=='f' || c[0]=='F') {
50--
512.40.0
diff --git a/meta-oe/recipes-support/iniparser/iniparser_4.1.bb b/meta-oe/recipes-support/iniparser/iniparser_4.1.bb
index 2810a4f65..7c23b514b 100644
--- a/meta-oe/recipes-support/iniparser/iniparser_4.1.bb
+++ b/meta-oe/recipes-support/iniparser/iniparser_4.1.bb
@@ -10,7 +10,9 @@ PV .= "+git${SRCPV}"
10 10
11SRC_URI = "git://github.com/ndevilla/iniparser.git;protocol=https;branch=master \ 11SRC_URI = "git://github.com/ndevilla/iniparser.git;protocol=https;branch=master \
12 file://0001-iniparser.pc-Make-libpath-a-variable.patch \ 12 file://0001-iniparser.pc-Make-libpath-a-variable.patch \
13 file://Add-CMake-support.patch" 13 file://Add-CMake-support.patch \
14 file://CVE-2023-33461.patch \
15"
14 16
15SRCREV= "deb85ad4936d4ca32cc2260ce43323d47936410d" 17SRCREV= "deb85ad4936d4ca32cc2260ce43323d47936410d"
16 18