aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/syntax.c
diff options
context:
space:
mode:
authorJurica Bradaric <jbradaric@gmail.com>2016-02-02 19:56:18 +0100
committerJurica Bradaric <jbradaric@gmail.com>2016-02-02 19:58:30 +0100
commitce2ff1ac0134d2b3b56eee1862d846e1fe9e4caf (patch)
treef56ce921dea704d21235fc3af6924765eb3cdb3a /src/nvim/syntax.c
parentf20818de3126b01fb6b18696db2621fa4880b632 (diff)
downloadrneovim-ce2ff1ac0134d2b3b56eee1862d846e1fe9e4caf.tar.gz
rneovim-ce2ff1ac0134d2b3b56eee1862d846e1fe9e4caf.tar.bz2
rneovim-ce2ff1ac0134d2b3b56eee1862d846e1fe9e4caf.zip
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
Diffstat (limited to 'src/nvim/syntax.c')
-rw-r--r--src/nvim/syntax.c5
1 files changed, 3 insertions, 2 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 */