aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2010-08-16 17:11:18 +1000
committernyamatongwe <devnull@localhost>2010-08-16 17:11:18 +1000
commit077ce5cdefea6299fbc3edbf0bacff10b7b72a4d (patch)
treef1f7f6e8a2365f611518c2dcb6d7230d75b4a533
parent4513adf441ef121aeea4de14912ad48cf99473c3 (diff)
downloadscintilla-mirror-077ce5cdefea6299fbc3edbf0bacff10b7b72a4d.tar.gz
Bug #3045386 fixed: Markdown lexer can hang in an infinite loop
Fix from Colomban Wendling.
-rw-r--r--lexers/LexMarkdown.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/lexers/LexMarkdown.cxx b/lexers/LexMarkdown.cxx
index df081de31..e3ffa6670 100644
--- a/lexers/LexMarkdown.cxx
+++ b/lexers/LexMarkdown.cxx
@@ -103,9 +103,9 @@ static void SetStateAndZoom(const int state, const int length, const int token,
static bool HasPrevLineContent(StyleContext &sc) {
int i = 0;
// Go back to the previous newline
- while ((--i + sc.currentPos) && !IsNewline(sc.GetRelative(i)))
+ while ((--i + (int)sc.currentPos) >= 0 && !IsNewline(sc.GetRelative(i)))
;
- while (--i + sc.currentPos) {
+ while ((--i + (int)sc.currentPos) >= 0) {
if (IsNewline(sc.GetRelative(i)))
break;
if (!IsASpaceOrTab(sc.GetRelative(i)))