SF.net SVN: geany:[5168] trunk

ntrel at users.sourceforge.net ntrel at xxxxx
Mon Aug 16 12:32:19 UTC 2010


Revision: 5168
          http://geany.svn.sourceforge.net/geany/?rev=5168&view=rev
Author:   ntrel
Date:     2010-08-16 12:32:18 +0000 (Mon, 16 Aug 2010)

Log Message:
-----------
Fix infinite loop in Markdown lexer (patch by Colomban Wendling,
thanks).

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/scintilla/LexMarkdown.cxx

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2010-08-16 12:21:22 UTC (rev 5167)
+++ trunk/ChangeLog	2010-08-16 12:32:18 UTC (rev 5168)
@@ -3,6 +3,9 @@
  * src/filetypes.c:
    Fix segfault on Tools->Reload Configuration when no documents are
    open (#3037079).
+ * scintilla/LexMarkdown.cxx:
+   Fix infinite loop in Markdown lexer (patch by Colomban Wendling,
+   thanks).
 
 
 2010-08-15  Enrico Tröger  <enrico(dot)troeger(at)uvena(dot)de>

Modified: trunk/scintilla/LexMarkdown.cxx
===================================================================
--- trunk/scintilla/LexMarkdown.cxx	2010-08-16 12:21:22 UTC (rev 5167)
+++ trunk/scintilla/LexMarkdown.cxx	2010-08-16 12:32:18 UTC (rev 5168)
@@ -100,9 +100,9 @@
 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)))


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the Commits mailing list