mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-02-21 20:09:56 +08:00
Fix NULL dereference when function name is not specified
It was possible to type `function ""; end`, and this caused fish to crash because of NULL pointer.
This commit is contained in:
parent
16534ec644
commit
13e1e7e1e9
@ -2002,6 +2002,7 @@ int define_function(parser_t &parser, const wcstring_list_t &c_args, const wcstr
|
||||
else if (! wcslen(argv[woptind]))
|
||||
{
|
||||
append_format(*out_err, _(L"%ls: No function name given\n"), argv[0]);
|
||||
res=1;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user