From 9d9be045aefdb0451754825249ab9a3281e66e49 Mon Sep 17 00:00:00 2001 From: Christian Grasser Date: Thu, 11 Jun 2015 11:22:05 +0200 Subject: [PATCH] avoid access violation with empty string s -> length == 0 --- scintilla/lexers/LexUser.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scintilla/lexers/LexUser.cxx b/scintilla/lexers/LexUser.cxx index 2529f9d9..491e6310 100644 --- a/scintilla/lexers/LexUser.cxx +++ b/scintilla/lexers/LexUser.cxx @@ -635,13 +635,13 @@ static inline void SubGroup(const char * s, vvstring & vec, bool group=false) for (unsigned int j=0; j= 2 && s[0] == '(' && s[1] == '(') { i = 2; group = true; } - if (s[length-1] == ')' && s[length-2] == ')') + if (length >= 2 && s[length - 1] == ')' && s[length - 2] == ')') length -= 2; if (!group && *s)