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:
0f44c08
)
lsmod: fox unsafe usage of strlen() - 1
author
Denys Vlasenko
<dvlasenk@redhat.com>
Tue, 11 Jan 2011 12:07:22 +0000
(13:07 +0100)
committer
Denys Vlasenko
<dvlasenk@redhat.com>
Tue, 11 Jan 2011 12:07:22 +0000
(13:07 +0100)
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
modutils/lsmod.c
patch
|
blob
|
history
diff --git
a/modutils/lsmod.c
b/modutils/lsmod.c
index ab7c11f2a77bfc8c9e4326af5afff6c2bc8bdaca..d7e16689b1ab37dcbf9e6a9a085edd5d8bed19e2 100644
(file)
--- a/
modutils/lsmod.c
+++ b/
modutils/lsmod.c
@@
-87,7
+87,8
@@
int lsmod_main(int argc UNUSED_PARAM, char **argv UNUSED_PARAM)
// N.B. token[3] is either '-' (module is not used by others)
// or comma-separated list ended by comma
// so trimming the trailing char is just what we need!
- token[3][strlen(token[3])-1] = '\0';
+ if (token[3][0])
+ token[3][strlen(token[3]) - 1] = '\0';
# if ENABLE_UNICODE_SUPPORT
{
uni_stat_t uni_stat;