modprobe: fix the NULL-termination of new_argv
The number of new arguments is (i + argc - 1) as it is set to *p_argc one line below. The correct location of NULL termination is new_argv[i + argc - 1]. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
This commit is contained in:
parent
f50e2d6757
commit
757b359923
|
@ -744,7 +744,7 @@ static char **prepend_options_from_env(int *p_argc, char **orig_argv)
|
|||
}
|
||||
|
||||
memcpy(new_argv + i, orig_argv + 1, sizeof(char *) * (argc - 1));
|
||||
new_argv[i + argc] = NULL;
|
||||
new_argv[i + argc - 1] = NULL;
|
||||
*p_argc = i + argc - 1;
|
||||
|
||||
return new_argv;
|
||||
|
|
Loading…
Reference in New Issue