[Geany-devel] [PATCH] Scintilla: Infinite loop in Markdown lexer

Colomban Wendling lists.ban at xxxxx
Sat Aug 14 17:25:43 UTC 2010


As reported in Debian's bug #590284 [1] the Scintilla Markdown lexer has
a bug that causes an infinite loop on certain circumstances.

In facts, it happens when HasPrevLineContent() is called on the second
line and the first line is empty, because of a negative index error.
Joined a patch that fixes the issue (and also fixes highlighting if the
first title is one-character only).
Joined is a patch that fixes the issue [2]

I haven't reported the bug to Scintilla yet, even if it seems to still
be present in current Mercurial version, because I can't find out how to
use the Markdown lexer with SciTE, so I can't test; but I also attach
the slightly-tuned patch for Scintilla [3] (it's exactly the same except
for a trailing whitespace that is in the Geany's Scintilla copy but not
If anyone can test and/or tell me how to do, it'd be cool :)

Best regards,

[1] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=590284
[2] 0001-geany-scintilla-lexer-markdown-fix-infinite-loop.patch
[3] 0001-scintilla-lexer-markdown-fix-infinite-loop.patch
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-geany-scintilla-lexer-markdown-fix-infinite-loop.patch
Type: text/x-patch
Size: 676 bytes
Desc: not available
URL: <http://lists.geany.org/pipermail/devel/attachments/20100814/6570635e/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-scintilla-lexer-markdown-fix-infinite-loop.patch
Type: text/x-patch
Size: 642 bytes
Desc: not available
URL: <http://lists.geany.org/pipermail/devel/attachments/20100814/6570635e/attachment-0001.bin>

More information about the Devel mailing list