modprobe: fix a segfault when modprobe is called with no arguments at all
function old new delta modprobe_main 559 535 -24
This commit is contained in:
@ -106,7 +106,7 @@ char * FAST_FUNC parse_cmdline_module_options(char **argv)
|
||||
while (*++argv) {
|
||||
options = xrealloc(options, optlen + 2 + strlen(*argv) + 2);
|
||||
/* Spaces handled by "" pairs, but no way of escaping quotes */
|
||||
optlen += sprintf(options + optlen, (strchr(*argv,' ') ? "\"%s\" " : "%s "), *argv);
|
||||
optlen += sprintf(options + optlen, (strchr(*argv, ' ') ? "\"%s\" " : "%s "), *argv);
|
||||
}
|
||||
return options;
|
||||
}
|
||||
|
Reference in New Issue
Block a user