changeset 11647:aa426eb9589d v8.0.0706

patch 8.0.0706: crash when cancelling the cmdline window in Ex mode commit https://github.com/vim/vim/commit/5a15b6aa0aa5c1559c6f1a9f06c595a8c564637d Author: Bram Moolenaar <Bram@vim.org> Date: Tue Jul 11 15:11:57 2017 +0200 patch 8.0.0706: crash when cancelling the cmdline window in Ex mode Problem: Crash when cancelling the cmdline window in Ex mode. (James McCoy) Solution: Do not set cmdbuff to NULL, make it empty.
author Christian Brabandt <cb@256bit.org>
date Tue, 11 Jul 2017 15:15:03 +0200
parents 6b272e247ffe
children d5fe79b99de4
files src/ex_getln.c src/version.c
diffstat 2 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/ex_getln.c
+++ b/src/ex_getln.c
@@ -7042,7 +7042,13 @@ open_cmdwin(void)
 	else
 	    ccline.cmdbuff = vim_strsave(ml_get_curline());
 	if (ccline.cmdbuff == NULL)
+	{
+	    ccline.cmdbuff = vim_strsave((char_u *)"");
+	    ccline.cmdlen = 0;
+	    ccline.cmdbufflen = 1;
+	    ccline.cmdpos = 0;
 	    cmdwin_result = Ctrl_C;
+	}
 	else
 	{
 	    ccline.cmdlen = (int)STRLEN(ccline.cmdbuff);
--- a/src/version.c
+++ b/src/version.c
@@ -765,6 +765,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    706,
+/**/
     705,
 /**/
     704,