projects
/
oweals
/
busybox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
17f8418
)
modprobe-small: fix safe_strncpy truncating last char of module name
author
Denys Vlasenko
<vda.linux@googlemail.com>
Mon, 26 May 2014 13:01:13 +0000
(15:01 +0200)
committer
Denys Vlasenko
<vda.linux@googlemail.com>
Mon, 26 May 2014 13:01:13 +0000
(15:01 +0200)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
modutils/modprobe-small.c
patch
|
blob
|
history
diff --git
a/modutils/modprobe-small.c
b/modutils/modprobe-small.c
index 91e0c1380885c33b5e764b9c5d31e7bb6e48acdf..b7990bff15e787abfcc5e26973cecbc60155fdae 100644
(file)
--- 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;