Mercurial > vim
changeset 6987:1661dd8df592 v7.4.811
patch 7.4.811
Problem: Invalid memory access when using "exe 'sc'".
Solution: Avoid going over the end of the string. (Dominique Pelle)
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Tue, 04 Aug 2015 22:02:51 +0200 |
parents | bf56568ed667 |
children | e86ada5d3fa0 |
files | src/ex_docmd.c src/version.c |
diffstat | 2 files changed, 4 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -3129,8 +3129,8 @@ find_command(eap, full) ++p; } else if (p[0] == 's' - && ((p[1] == 'c' && p[2] != 's' && p[2] != 'r' - && p[3] != 'i' && p[4] != 'p') + && ((p[1] == 'c' && (p[2] == NUL || (p[2] != 's' && p[2] != 'r' + && (p[3] == NUL || (p[3] != 'i' && p[4] != 'p'))))) || p[1] == 'g' || (p[1] == 'i' && p[2] != 'm' && p[2] != 'l' && p[2] != 'g') || p[1] == 'I'