mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-26 12:53:13 +00: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
1 changed files with 1 additions and 0 deletions
|
@ -2002,6 +2002,7 @@ int define_function(parser_t &parser, const wcstring_list_t &c_args, const wcstr
|
||||||
else if (! wcslen(argv[woptind]))
|
else if (! wcslen(argv[woptind]))
|
||||||
{
|
{
|
||||||
append_format(*out_err, _(L"%ls: No function name given\n"), argv[0]);
|
append_format(*out_err, _(L"%ls: No function name given\n"), argv[0]);
|
||||||
|
res=1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue