[Bug 173964] kmail crashes while parsing ~/.procmailrc

George Kiagiadakis gkiagiad at csd.uoc.gr
Sun Nov 16 11:40:51 GMT 2008


http://bugs.kde.org/show_bug.cgi?id=173964





--- Comment #4 from George Kiagiadakis <gkiagiad csd uoc gr>  2008-11-16 12:40:51 ---
if my theory is right, here is a possible fix:

Index: accountdialog.cpp
===================================================================
--- accountdialog.cpp   (revision 884939)
+++ accountdialog.cpp   (working copy)
@@ -218,7 +218,7 @@
     prevLine = line;
     line = mStream->readLine().trimmed();
   } while ( !mStream->atEnd() && (line[0] == '*' ||
-                                prevLine[prevLine.length() - 1] == '\\' ));
+               (prevLine.length() > 0 && prevLine[prevLine.length() - 1] ==
'\\') ));

   if( line[0] != '!' && line[0] != '|' &&  line[0] != '{' ) {
     // this is a filename, expand it


PS: it seems to me that this could crash only in the following case: have one
line that starts with '*' and ends with '\', followed by an empty line,
followed by a line that doesn't start with '*'. Is that the case Alexander?


-- 
Configure bugmail: http://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the Kdepim-bugs mailing list