diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-02-13 21:29:32 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-02-13 21:29:32 +0100 |
commit | 21456cdccbdf9d222938139769f1abe95b8effdd (patch) | |
tree | d5d71fb7b621390690e1495e296da3f91d94eca1 /src/vim9execute.c | |
parent | 3dd64608f6183a49c6854652017b928556224935 (diff) |
patch 8.2.0253: crash when using :disassamble without argumentv8.2.0253
Problem: Crash when using :disassamble without argument. (Dhiraj Mishra)
Solution: Check for missing argument. (Dominique Pelle, closes #5635,
closes #5637)
Diffstat (limited to 'src/vim9execute.c')
-rw-r--r-- | src/vim9execute.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/vim9execute.c b/src/vim9execute.c index ed3a75b106..c31506a86d 100644 --- a/src/vim9execute.c +++ b/src/vim9execute.c @@ -1590,6 +1590,7 @@ failed: void ex_disassemble(exarg_T *eap) { + char_u *arg = eap->arg; char_u *fname; ufunc_T *ufunc; dfunc_T *dfunc; @@ -1598,8 +1599,14 @@ ex_disassemble(exarg_T *eap) int line_idx = 0; int prev_current = 0; - fname = trans_function_name(&eap->arg, FALSE, + fname = trans_function_name(&arg, FALSE, TFN_INT | TFN_QUIET | TFN_NO_AUTOLOAD | TFN_NO_DEREF, NULL, NULL); + if (fname == NULL) + { + semsg(_(e_invarg2), eap->arg); + return; + } + ufunc = find_func(fname, NULL); vim_free(fname); if (ufunc == NULL) |