From 4df34a4d0d5183135217fc8280faae8e697147bc Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Sat, 15 Jun 2019 23:49:28 +0200 Subject: [PATCH] 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 Signed-off-by: Hauke Mehrtens --- kmodloader.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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"); -- 2.25.1