diff options
author | 2014-05-06 12:07:16 +0200 | |
---|---|---|
committer | 2014-05-06 12:07:16 +0200 | |
commit | 13e1e7e1e94fb2102986e826765c7801f6cd8332 (patch) | |
tree | 4d1824e7ebb2fca065dda137a12807815b698ea1 /builtin.cpp | |
parent | 16534ec64492b7c08e5837b9da83072452813f28 (diff) |
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.
Diffstat (limited to 'builtin.cpp')
-rw-r--r-- | builtin.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/builtin.cpp b/builtin.cpp index 741dbd4a..fadd5a4a 100644 --- a/builtin.cpp +++ b/builtin.cpp @@ -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 { |