summaryrefslogtreecommitdiffstats
path: root/meta-networking/recipes-daemons/opensaf/opensaf/0008-check-for-size-before-using-strncpy.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-networking/recipes-daemons/opensaf/opensaf/0008-check-for-size-before-using-strncpy.patch')
-rw-r--r--meta-networking/recipes-daemons/opensaf/opensaf/0008-check-for-size-before-using-strncpy.patch33
1 files changed, 33 insertions, 0 deletions
diff --git a/meta-networking/recipes-daemons/opensaf/opensaf/0008-check-for-size-before-using-strncpy.patch b/meta-networking/recipes-daemons/opensaf/opensaf/0008-check-for-size-before-using-strncpy.patch
new file mode 100644
index 000000000..497bb07d8
--- /dev/null
+++ b/meta-networking/recipes-daemons/opensaf/opensaf/0008-check-for-size-before-using-strncpy.patch
@@ -0,0 +1,33 @@
1From 29510dd81e3a5e96151afdb0702863cbfd640766 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 22 Jun 2018 18:58:59 -0700
4Subject: [PATCH] check for size before using strncpy
5
6ensures that size is never execeding the string length
7that execPath can hold
8
9Fixes
10error: '__builtin___strncpy_chk' specified size between 18446744071562067968 and 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Werror=stringop-overflow=]
11
12Upstream-Status: Pending
13
14Signed-off-by: Khem Raj <raj.khem@gmail.com>
15---
16 src/imm/immnd/immnd_proc.c | 4 ++++
17 1 file changed, 4 insertions(+)
18
19diff --git a/src/imm/immnd/immnd_proc.c b/src/imm/immnd/immnd_proc.c
20index 015932a..c8f115e 100644
21--- a/src/imm/immnd/immnd_proc.c
22+++ b/src/imm/immnd/immnd_proc.c
23@@ -1902,6 +1902,10 @@ static int immnd_forkPbe(IMMND_CB *cb)
24 LOG_ER("Pathname too long: %u max is 1023", newLen);
25 return -1;
26 }
27+ if (execDirLen > 1023 || execDirLen < 0) {
28+ LOG_ER("Execdir name too long: %u max is 1023", execDirLen);
29+ return -1;
30+ }
31
32 strncpy(execPath, cb->mProgName, execDirLen);
33 execPath[execDirLen] = 0;