diff src/vim9execute.c @ 19390:e4b326c9424a v8.2.0253

patch 8.2.0253: crash when using :disassamble without argument Commit: https://github.com/vim/vim/commit/21456cdccbdf9d222938139769f1abe95b8effdd Author: Bram Moolenaar <Bram@vim.org> Date: Thu Feb 13 21:29:32 2020 +0100 patch 8.2.0253: crash when using :disassamble without argument Problem: Crash when using :disassamble without argument. (Dhiraj Mishra) Solution: Check for missing argument. (Dominique Pelle, closes https://github.com/vim/vim/issues/5635, closes #5637)
author Bram Moolenaar <Bram@vim.org>
date Thu, 13 Feb 2020 21:30:09 +0100
parents 8ff84bc1c89b
children bc880a130120
line wrap: on
line diff
--- 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)