From: Alexander Couzens Date: Sun, 11 Jun 2017 10:13:05 +0000 (+0200) Subject: kmodloader/get_module_name: null-terminate the string X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fubox.git;a=commitdiff_plain;h=278c4c46a807414f887a8d6fdf1f50e673ac9551;hp=16f7e16181e2f3e9cf3e2ce56a7e291844900d09 kmodloader/get_module_name: null-terminate the string Found-by: Coverity Scan #1412291 Signed-off-by: Alexander Couzens --- diff --git a/kmodloader.c b/kmodloader.c index ed8f833..9aba523 100644 --- a/kmodloader.c +++ b/kmodloader.c @@ -155,10 +155,10 @@ static char* get_module_path(char *name) static char* get_module_name(char *path) { - static char name[32]; + static char name[33]; char *t; - strncpy(name, basename(path), sizeof(name)); + strncpy(name, basename(path), sizeof(name) - 1); t = strstr(name, ".ko"); if (t)