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:
parent
b9b344aa44
commit
bb26db49b1
2 changed files with 29 additions and 25 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue