--===============3745863120476444168== Content-Type: multipart/alternative; boundary="===============1162225001824025917==" --===============1162225001824025917== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://git.reviewboard.kde.org/r/111754/ ----------------------------------------------------------- (Updated Dec. 26, 2013, 7:08 p.m.) Status ------ This change has been marked as submitted. Review request for Kate, Christoph Cullmann, Dominik Haumann, and Milian Wolff. Repository: kate Description ------- The syntax highlighter currently has some kind of protection against infinite loops induced by buggy highlighting XML. Resolution of bug 144599 is an example of such a protection. However, with such concepts as "lookAhead", which basically matches null strings, the risk of infinite loops cannot be sanely guaranteed by ad-hoc patches produced on an on-bug basis, but rather requires a framework that per se offers such a guaranty. The patch proposes an implementation for this. It registers the current state, in terms of offset within the line coupled with context so that it is able to branch to "no match" when it encounters the same situation twice. The "no match" branch in turn does not loop on an already encountered context, but rather leads to the default path, which increments the offset. The patch is a few lines long, but requires indentation, which leads to white space noise. Test XML and text are included for the specific case of some infinite loops not dealt until now. Diffs ----- part/syntax/katehighlight.cpp f44f74e tests/data/syntax/infinite.txt PRE-CREATION tests/data/syntax/infinite.xml PRE-CREATION Diff: https://git.reviewboard.kde.org/r/111754/diff/ Testing ------- Opened randomly files with different syntaxes. Opened specifically infinite.xml with XML highlighter, and infinite.txt with infinite.xml highlighter. infinite.txt with infinite.xml highlighter falls into infinite loop without the patch. Thanks, Bruno Vasselle --===============1162225001824025917== Content-Type: text/html; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit
This is an automatically generated e-mail. To reply, visit: https://git.reviewboard.kde.org/r/111754/

This change has been marked as submitted.


Review request for Kate, Christoph Cullmann, Dominik Haumann, and Milian Wolff.
By Bruno Vasselle.

Updated Dec. 26, 2013, 7:08 p.m.

Repository: kate

Description

The syntax highlighter currently has some kind of protection against infinite loops induced by buggy highlighting XML. Resolution of bug 144599 is an example of such a protection.

However, with such concepts as "lookAhead", which basically matches null strings, the risk of infinite loops cannot be sanely guaranteed by ad-hoc patches produced on an on-bug basis, but rather requires a framework that per se offers such a guaranty.

The patch proposes an implementation for this. It registers the current state, in terms of offset within the line coupled with context so that it is able to branch to "no match" when it encounters the same situation twice. The "no match" branch in turn does not loop on an already encountered context, but rather leads to the default path, which increments the offset.

The patch is a few lines long, but requires indentation, which leads to white space noise.

Test XML and text are included for the specific case of some infinite loops not dealt until now.

Testing

Opened randomly files with different syntaxes. Opened specifically infinite.xml with XML highlighter, and infinite.txt with infinite.xml highlighter. 

infinite.txt with infinite.xml highlighter falls into infinite loop without the patch.

Diffs

  • part/syntax/katehighlight.cpp (f44f74e)
  • tests/data/syntax/infinite.txt (PRE-CREATION)
  • tests/data/syntax/infinite.xml (PRE-CREATION)

View Diff

--===============1162225001824025917==-- --===============3745863120476444168== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ KWrite-Devel mailing list KWrite-Devel@kde.org https://mail.kde.org/mailman/listinfo/kwrite-devel --===============3745863120476444168==--