From ce2ff1ac0134d2b3b56eee1862d846e1fe9e4caf Mon Sep 17 00:00:00 2001 From: Jurica Bradaric Date: Tue, 2 Feb 2016 19:56:18 +0100 Subject: vim-patch:7.4.814 Problem: Illegal memory access with "sy match a fold". Solution: Check for empty string. (Dominique Pelle) https://github.com/vim/vim/commit/382197865ca8353a3d6681a364f95bda6aed95ec --- src/nvim/syntax.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/nvim/syntax.c') diff --git a/src/nvim/syntax.c b/src/nvim/syntax.c index 24422c71fb..e91ea68891 100644 --- a/src/nvim/syntax.c +++ b/src/nvim/syntax.c @@ -4843,9 +4843,10 @@ static char_u *get_syn_pattern(char_u *arg, synpat_T *ci) int idx; char_u *cpo_save; - /* need at least three chars */ - if (arg == NULL || arg[1] == NUL || arg[2] == NUL) + // need at least three chars + if (arg == NULL || arg[0] == NUL || arg[1] == NUL || arg[2] == NUL) { return NULL; + } end = skip_regexp(arg + 1, *arg, TRUE, NULL); if (*end != *arg) { /* end delimiter not found */ -- cgit