From ce2ff1ac0134d2b3b56eee1862d846e1fe9e4caf Mon Sep 17 00:00:00 2001 From: Jurica Bradaric Date: Tue, 2 Feb 2016 19:56:18 +0100 Subject: [PATCH] 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 +++-- src/nvim/version.c | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) 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 */ diff --git a/src/nvim/version.c b/src/nvim/version.c index 31a839fd05..d554ec0c84 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -474,7 +474,7 @@ static int included_patches[] = { // 817, // 816, // 815, - // 814, + 814, 813, // 812, 811,