diff src/syntax.c @ 6993:dcc108222d70 v7.4.814

patch 7.4.814 Problem: Illegal memory access with "sy match a fold". Solution: Check for empty string. (Dominique Pelle)
author Bram Moolenaar <bram@vim.org>
date Tue, 11 Aug 2015 15:27:13 +0200
parents bcc0909b379e
children 286fd54c7ae3
line wrap: on
line diff
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -5654,7 +5654,7 @@ get_syn_pattern(arg, ci)
     char_u	*cpo_save;
 
     /* need at least three chars */
-    if (arg == NULL || arg[1] == NUL || arg[2] == NUL)
+    if (arg == NULL || arg[0] == NUL || arg[1] == NUL || arg[2] == NUL)
 	return NULL;
 
     end = skip_regexp(arg + 1, *arg, TRUE, NULL);