From 278c4c46a807414f887a8d6fdf1f50e673ac9551 Mon Sep 17 00:00:00 2001 From: Alexander Couzens Date: Sun, 11 Jun 2017 12:13:05 +0200 Subject: [PATCH] kmodloader/get_module_name: null-terminate the string Found-by: Coverity Scan #1412291 Signed-off-by: Alexander Couzens --- kmodloader.c | 4 ++-- 1 file 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) -- 2.25.1