← Commit list

fd0640e5a

Denys Vlasenko
Denys Vlasenko
2014-05-26
SUCCESS Duration: 143s

Subject

modprobe-small: fix safe_strncpy truncating last char of module name

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/modprobe-small.c+1 -1
@@ -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;