summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLee Chee Yang <chee.yang.lee@intel.com>2023-09-22 17:59:38 +0800
committerKhem Raj <raj.khem@gmail.com>2023-09-22 07:36:16 -0700
commit670b2776e12b54b05df3c580a2c24ec3f58bb71b (patch)
tree810b471712b2cc4bec8d5ca09c30ef1e5f0f5224
parentac294390b9125d415a781846649af1af9797afd8 (diff)
downloadmeta-openembedded-670b2776e12b54b05df3c580a2c24ec3f58bb71b.tar.gz
iniparser: Fix CVE-2023-33461
Signed-off-by: Lee Chee Yang <chee.yang.lee@intel.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r--meta-oe/recipes-support/iniparser/iniparser/CVE-2023-33461.patch48
-rw-r--r--meta-oe/recipes-support/iniparser/iniparser_4.1.bb4
2 files changed, 51 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 0000000000..db5fb06aac
--- /dev/null
+++ b/meta-oe/recipes-support/iniparser/iniparser/CVE-2023-33461.patch
@@ -0,0 +1,48 @@
1CVE: CVE-2023-33461
2Upstream-Status: Backport [https://github.com/ndevilla/iniparser/pull/146/commits/ace9871f65d11b5d73f0b9ee8cf5d2807439442d]
3Signed-off-by: Lee Chee Yang <chee.yang.lee@intel.com>
4
5
6From ace9871f65d11b5d73f0b9ee8cf5d2807439442d Mon Sep 17 00:00:00 2001
7From: Antonio <antoniolrt@gmail.com>
8Date: Fri, 2 Jun 2023 15:03:10 -0300
9Subject: [PATCH] Handle null return from iniparser_getstring
10
11Fix handling of NULL returns from iniparser_getstring in
12iniparser_getboolean, iniparser_getlongint and iniparser_getdouble,
13avoiding a crash.
14---
15 src/iniparser.c | 6 +++---
16 1 file changed, 3 insertions(+), 3 deletions(-)
17
18diff --git a/src/iniparser.c b/src/iniparser.c
19index f1d1658..dbceb20 100644
20--- a/src/iniparser.c
21+++ b/src/iniparser.c
22@@ -456,7 +456,7 @@ long int iniparser_getlongint(const dictionary * d, const char * key, long int n
23 const char * str ;
24
25 str = iniparser_getstring(d, key, INI_INVALID_KEY);
26- if (str==INI_INVALID_KEY) return notfound ;
27+ if (str==NULL || str==INI_INVALID_KEY) return notfound ;
28 return strtol(str, NULL, 0);
29 }
30
31@@ -511,7 +511,7 @@ double iniparser_getdouble(const dictionary * d, const char * key, double notfou
32 const char * str ;
33
34 str = iniparser_getstring(d, key, INI_INVALID_KEY);
35- if (str==INI_INVALID_KEY) return notfound ;
36+ if (str==NULL || str==INI_INVALID_KEY) return notfound ;
37 return atof(str);
38 }
39
40@@ -553,7 +553,7 @@ int iniparser_getboolean(const dictionary * d, const char * key, int notfound)
41 const char * c ;
42
43 c = iniparser_getstring(d, key, INI_INVALID_KEY);
44- if (c==INI_INVALID_KEY) return notfound ;
45+ if (c==NULL || c==INI_INVALID_KEY) return notfound ;
46 if (c[0]=='y' || c[0]=='Y' || c[0]=='1' || c[0]=='t' || c[0]=='T') {
47 ret = 1 ;
48 } else if (c[0]=='n' || c[0]=='N' || c[0]=='0' || c[0]=='f' || c[0]=='F') {
diff --git a/meta-oe/recipes-support/iniparser/iniparser_4.1.bb b/meta-oe/recipes-support/iniparser/iniparser_4.1.bb
index f9e1530161..5e42cdcb06 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