From cdc7250cd8ca948d15c158789f621a71d5c7b35d Mon Sep 17 00:00:00 2001 From: Jurica Bradaric Date: Tue, 2 Feb 2016 18:34:04 +0100 Subject: vim-patch:7.4.800 Problem: Using freed memory when triggering CmdUndefined autocommands. Solution: Set pointer to NULL. (Dominique Pelle) https://github.com/vim/vim/commit/829aef1eb48b17445b1f0a801948c1b826f507f8 --- src/nvim/ex_docmd.c | 6 +++--- src/nvim/version.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index 1ae440c757..755e1b9f64 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -1702,9 +1702,9 @@ static char_u * do_one_cmd(char_u **cmdlinep, p = vim_strnsave(ea.cmd, p - ea.cmd); int ret = apply_autocmds(EVENT_CMDUNDEFINED, p, p, TRUE, NULL); xfree(p); - if (ret && !aborting()) { - p = find_command(&ea, NULL); - } + // If the autocommands did something and didn't cause an error, try + // finding the command again. + p = (ret && !aborting()) ? find_command(&ea, NULL) : NULL; } if (p == NULL) { diff --git a/src/nvim/version.c b/src/nvim/version.c index 228bc6a6d0..7a044a2a65 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -488,7 +488,7 @@ static int included_patches[] = { 803, 802, // 801, - // 800, + 800, 799, 798, // 797, -- cgit