← Commit list

5a163b264

Denys Vlasenko
Denys Vlasenko
2011-01-11
FAILED Duration: 251s

Subject

lsmod: fox unsafe usage of strlen() - 1

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

modutils/lsmod.c+2 -1
@@ -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;