diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2009-02-26 12:00:29 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2009-02-26 12:00:29 +0000 |
commit | f62f761936ed33fa89680f5d129db55bee610eb9 (patch) | |
tree | ddb54a431f79c3f70663ea0a022a302eeeec8659 /modutils/modutils.c | |
parent | a76f10b544b4ffe4b0aaf41eede1aeb9b13a95e8 (diff) | |
download | busybox-w32-f62f761936ed33fa89680f5d129db55bee610eb9.tar.gz busybox-w32-f62f761936ed33fa89680f5d129db55bee610eb9.tar.bz2 busybox-w32-f62f761936ed33fa89680f5d129db55bee610eb9.zip |
modutils: overflow fix
Diffstat (limited to 'modutils/modutils.c')
-rw-r--r-- | modutils/modutils.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/modutils/modutils.c b/modutils/modutils.c index 0d7d72d8b..8836f7c69 100644 --- a/modutils/modutils.c +++ b/modutils/modutils.c | |||
@@ -71,7 +71,7 @@ char * FAST_FUNC filename2modname(const char *filename, char *modname) | |||
71 | if (modname == NULL) | 71 | if (modname == NULL) |
72 | modname = xmalloc(MODULE_NAME_LEN); | 72 | modname = xmalloc(MODULE_NAME_LEN); |
73 | from = bb_get_last_path_component_nostrip(filename); | 73 | from = bb_get_last_path_component_nostrip(filename); |
74 | for (i = 0; i < MODULE_NAME_LEN && from[i] != '\0' && from[i] != '.'; i++) | 74 | for (i = 0; i < (MODULE_NAME_LEN-1) && from[i] != '\0' && from[i] != '.'; i++) |
75 | modname[i] = (from[i] == '-') ? '_' : from[i]; | 75 | modname[i] = (from[i] == '-') ? '_' : from[i]; |
76 | modname[i] = 0; | 76 | modname[i] = 0; |
77 | 77 | ||