mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-26 12:53:13 +00:00
Don't corrupt memory when setting a slice with wrong # of args
Fixes #4881.
This commit is contained in:
parent
5d01399586
commit
f7ba2a6a00
1 changed files with 1 additions and 0 deletions
|
@ -689,6 +689,7 @@ static int set_var_slices(const wchar_t *cmd, set_cmd_opts_t &opts, const wchar_
|
|||
|
||||
if (indexes.size() != static_cast<size_t>(argc)) {
|
||||
streams.err.append_format(BUILTIN_SET_MISMATCHED_ARGS, cmd, indexes.size(), argc);
|
||||
return STATUS_INVALID_ARGS;
|
||||
}
|
||||
|
||||
int scope = compute_scope(opts); // calculate the variable scope based on the provided options
|
||||
|
|
Loading…
Reference in a new issue