summaryrefslogtreecommitdiff
path: root/kmodloader.c
diff options
context:
space:
mode:
authorAlexander Couzens <lynxis@fe80.eu>2017-06-11 12:13:05 +0200
committerAlexander Couzens <lynxis@fe80.eu>2017-06-11 14:29:13 +0200
commit278c4c46a807414f887a8d6fdf1f50e673ac9551 (patch)
tree7bf31399dfacca4b235ce423bf41f52042e0f45d /kmodloader.c
parent16f7e16181e2f3e9cf3e2ce56a7e291844900d09 (diff)
downloadubox-278c4c46a807414f887a8d6fdf1f50e673ac9551.tar.gz
kmodloader/get_module_name: null-terminate the string
Found-by: Coverity Scan #1412291 Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
Diffstat (limited to 'kmodloader.c')
-rw-r--r--kmodloader.c4
1 files changed, 2 insertions, 2 deletions
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)