From 829aef1eb48b17445b1f0a801948c1b826f507f8 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Tue, 28 Jul 2015 14:25:48 +0200 Subject: patch 7.4.800 Problem: Using freed memory when triggering CmdUndefined autocommands. Solution: Set pointer to NULL. (Dominique Pelle) --- src/ex_docmd.c | 5 +++-- src/version.c | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/ex_docmd.c b/src/ex_docmd.c index 00485e359..251275759 100644 --- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -2365,8 +2365,9 @@ do_one_cmd(cmdlinep, sourcing, p = vim_strnsave(ea.cmd, (int)(p - ea.cmd)); ret = apply_autocmds(EVENT_CMDUNDEFINED, p, p, TRUE, NULL); vim_free(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; } #endif diff --git a/src/version.c b/src/version.c index 718ea3111..cf4d74ae3 100644 --- a/src/version.c +++ b/src/version.c @@ -741,6 +741,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 800, /**/ 799, /**/ -- cgit v1.2.3