executor: return instead of assert on invalid command line arguments
Before the split, it made sense to assert, as checks were on setup. But now these come from deserialization, and the fuzzer hits the asserts, so simply return an error instead.
This commit is contained in:
committed by
Luca Boccassi
parent
974959e6f6
commit
856bed0abe
@@ -3914,8 +3914,14 @@ int exec_invoke(
|
||||
assert(exit_status);
|
||||
|
||||
/* Explicitly test for CVE-2021-4034 inspired invocations */
|
||||
assert(command->path);
|
||||
assert(!strv_isempty(command->argv));
|
||||
if (!command->path || strv_isempty(command->argv)) {
|
||||
*exit_status = EXIT_EXEC;
|
||||
return log_exec_error_errno(
|
||||
context,
|
||||
params,
|
||||
SYNTHETIC_ERRNO(EINVAL),
|
||||
"Invalid command line arguments.");
|
||||
}
|
||||
|
||||
LOG_CONTEXT_PUSH_EXEC(context, params);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user