diff options
author | nyamatongwe <unknown> | 2010-08-16 17:11:18 +1000 |
---|---|---|
committer | nyamatongwe <unknown> | 2010-08-16 17:11:18 +1000 |
commit | 6683e39412174c147507a661db8b9b81fafa8abe (patch) | |
tree | cdabb527fc988d284fc49c5138f9e04b92b35443 /lexers/LexMarkdown.cxx | |
parent | 0ecc157a84f1f7afe3164c7f5c64855aa6610274 (diff) | |
download | scintilla-mirror-6683e39412174c147507a661db8b9b81fafa8abe.tar.gz |
Bug #3045386 fixed: Markdown lexer can hang in an infinite loop
Fix from Colomban Wendling.
Diffstat (limited to 'lexers/LexMarkdown.cxx')
-rw-r--r-- | lexers/LexMarkdown.cxx | 4 |
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))) |