aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <dvlasenk@redhat.com>2011-01-11 13:07:22 +0100
committerDenys Vlasenko <dvlasenk@redhat.com>2011-01-11 13:07:22 +0100
commit5a163b26451c591187482f99659e5fe639a0616a (patch)
treefbaef720c39bbfad1f38531ac15e2959c9716abc
parent0f44c08560a5287fb927c15a3cce54302a0b80e5 (diff)
downloadbusybox-w32-5a163b26451c591187482f99659e5fe639a0616a.tar.gz
busybox-w32-5a163b26451c591187482f99659e5fe639a0616a.tar.bz2
busybox-w32-5a163b26451c591187482f99659e5fe639a0616a.zip
lsmod: fox unsafe usage of strlen() - 1
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
-rw-r--r--modutils/lsmod.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/modutils/lsmod.c b/modutils/lsmod.c
index ab7c11f2a..d7e16689b 100644
--- a/modutils/lsmod.c
+++ b/modutils/lsmod.c
@@ -87,7 +87,8 @@ int lsmod_main(int argc UNUSED_PARAM, char **argv UNUSED_PARAM)
87 // N.B. token[3] is either '-' (module is not used by others) 87 // N.B. token[3] is either '-' (module is not used by others)
88 // or comma-separated list ended by comma 88 // or comma-separated list ended by comma
89 // so trimming the trailing char is just what we need! 89 // so trimming the trailing char is just what we need!
90 token[3][strlen(token[3])-1] = '\0'; 90 if (token[3][0])
91 token[3][strlen(token[3]) - 1] = '\0';
91# if ENABLE_UNICODE_SUPPORT 92# if ENABLE_UNICODE_SUPPORT
92 { 93 {
93 uni_stat_t uni_stat; 94 uni_stat_t uni_stat;