From: Hauke Mehrtens Date: Sat, 15 Jun 2019 21:49:28 +0000 (+0200) Subject: kmodloader: Increase path array size to make it always fit X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=4df34a4d0d5183135217fc8280faae8e697147bc;p=oweals%2Fubox.git 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 --- 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");