summaryrefslogtreecommitdiff
path: root/kmodloader.c
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke@hauke-m.de>2019-06-15 23:49:28 +0200
committerHauke Mehrtens <hauke@hauke-m.de>2019-06-16 15:42:32 +0200
commit4df34a4d0d5183135217fc8280faae8e697147bc (patch)
tree040fe7987130f8543ec23ace4d5dc28ae64d01e2 /kmodloader.c
parent5130fa4d9c5d15d643506f906927b209d7690a83 (diff)
downloadubox-4df34a4d0d5183135217fc8280faae8e697147bc.tar.gz
kmodloader: Increase path array size to make it always fit
When DEF_MOD_PATH (10 bytes), s (max 255 bytes) and ver.release (max 64 bytes) are all written into path, 256 bytes will not fit, increase the available size. All given sizes are given without terminating NULL byte and we add one byte to store the NULL byte. GCC 9.1 warns about this condition and we treat warnings as errors in ubox. Reported-by: Joseph Benden <joe@benden.us> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Diffstat (limited to 'kmodloader.c')
-rw-r--r--kmodloader.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kmodloader.c b/kmodloader.c
index 6a7d7c1..422c895 100644
--- a/kmodloader.c
+++ b/kmodloader.c
@@ -75,7 +75,7 @@ static int init_module_folders(void)
int n = 0;
struct stat st;
struct utsname ver;
- char *s, *e, *p, path[256], ldpath[256];
+ char *s, *e, *p, path[330], ldpath[256];
e = ldpath;
s = getenv("LD_LIBRARY_PATH");