summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2022-02-04 09:26:36 -0800
committerKhem Raj <raj.khem@gmail.com>2022-02-04 09:27:57 -0800
commit95f7f8c51de5617bb7451b7adbf22741fec73644 (patch)
treea7cbdba06083d15b5d29b2fb037c2f0783c00a0f
parent9eb9b02dc5760a1c179c5fb9e509e4db72af12d8 (diff)
downloadmeta-openembedded-95f7f8c51de5617bb7451b7adbf22741fec73644.tar.gz
crda: Fix buffer overflow in sscanf
Fixes build with clang14 Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r--meta-networking/recipes-connectivity/crda/crda/0001-Make-alpha2-to-be-3-characters-long.patch31
-rw-r--r--meta-networking/recipes-connectivity/crda/crda_3.18.bb1
2 files changed, 32 insertions, 0 deletions
diff --git a/meta-networking/recipes-connectivity/crda/crda/0001-Make-alpha2-to-be-3-characters-long.patch b/meta-networking/recipes-connectivity/crda/crda/0001-Make-alpha2-to-be-3-characters-long.patch
new file mode 100644
index 000000000..f1d2cbc5a
--- /dev/null
+++ b/meta-networking/recipes-connectivity/crda/crda/0001-Make-alpha2-to-be-3-characters-long.patch
@@ -0,0 +1,31 @@
1From 078e962d345fd0536fe7ba797485ee1a4159c032 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 4 Feb 2022 09:18:30 -0800
4Subject: [PATCH] Make alpha2 to be 3 characters long
5
6Fixes buffer overflow
7reglib.c:969:9: error: 'sscanf' may overflow; destination buffer in argument 3 has size 2, but the corresponding specifier may require size 3 [-Werror,-Wfortify-source]
8 alpha2,
9 ^
10Upstream-Status: Pending
11Signed-off-by: Khem Raj <raj.khem@gmail.com>
12---
13 reglib.c | 2 +-
14 1 file changed, 1 insertion(+), 1 deletion(-)
15
16diff --git a/reglib.c b/reglib.c
17index e00e9b8..8565a0b 100644
18--- a/reglib.c
19+++ b/reglib.c
20@@ -958,7 +958,7 @@ reglib_parse_rules(FILE *fp, struct ieee80211_regdomain *trd)
21 static int reglib_parse_country_dfs(char *line, struct ieee80211_regdomain *rd)
22 {
23 char dfs_region_alpha[9];
24- char alpha2[2];
25+ char alpha2[3];
26 int hits;
27
28 memset(rd, 0, sizeof(*rd));
29--
302.35.1
31
diff --git a/meta-networking/recipes-connectivity/crda/crda_3.18.bb b/meta-networking/recipes-connectivity/crda/crda_3.18.bb
index f99dfd66f..9abfd61cf 100644
--- a/meta-networking/recipes-connectivity/crda/crda_3.18.bb
+++ b/meta-networking/recipes-connectivity/crda/crda_3.18.bb
@@ -15,6 +15,7 @@ SRC_URI = "https://www.kernel.org/pub/software/network/${BPN}/${BP}.tar.xz \
15 file://use-target-word-size-instead-of-host-s.patch \ 15 file://use-target-word-size-instead-of-host-s.patch \
16 file://fix-issues-when-USE_OPENSSL-1.patch \ 16 file://fix-issues-when-USE_OPENSSL-1.patch \
17 file://crda-4.14-python-3.patch \ 17 file://crda-4.14-python-3.patch \
18 file://0001-Make-alpha2-to-be-3-characters-long.patch \
18" 19"
19SRC_URI[md5sum] = "0431fef3067bf503dfb464069f06163a" 20SRC_URI[md5sum] = "0431fef3067bf503dfb464069f06163a"
20SRC_URI[sha256sum] = "43fcb9679f8b75ed87ad10944a506292def13e4afb194afa7aa921b01e8ecdbf" 21SRC_URI[sha256sum] = "43fcb9679f8b75ed87ad10944a506292def13e4afb194afa7aa921b01e8ecdbf"