aboutsummaryrefslogtreecommitdiff
path: root/modutils
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2014-05-26 15:01:13 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2014-05-26 15:01:13 +0200
commitfd0640e5a12f74b7ab1d918cf884df0c59402c5a (patch)
tree9b0dcd1b1963e7950d86928e9c031321f0e6a6e1 /modutils
parent17f8418ea75410c3fbf9c9558f50f22cb8808e3e (diff)
downloadbusybox-fd0640e5a12f74b7ab1d918cf884df0c59402c5a.tar.gz
modprobe-small: fix safe_strncpy truncating last char of module name
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'modutils')
-rw-r--r--modutils/modprobe-small.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/modutils/modprobe-small.c b/modutils/modprobe-small.c
index 91e0c1380..b7990bff1 100644
--- a/modutils/modprobe-small.c
+++ b/modutils/modprobe-small.c
@@ -297,7 +297,7 @@ static int pathname_matches_modname(const char *pathname, const char *modname)
char name[MODULE_NAME_LEN];
const char *fname = bb_get_last_path_component_nostrip(pathname);
const char *suffix = strrstr(fname, ".ko");
- safe_strncpy(name, fname, suffix - fname);
+ safe_strncpy(name, fname, suffix - fname + 1);
replace(name, '-', '_');
r = (strcmp(name, modname) == 0);
return r;