File r890876-procmail-crash.diff of Package kdepim4
Subject: Fix crash on parsing procmail file
From: wstephenson@suse.de
Bug: kde#173964
Patch-Upstream: 890876
Index: kmail/accountdialog.cpp
===================================================================
--- kmail/accountdialog.cpp (revision 890875)
+++ kmail/accountdialog.cpp (revision 890876)
@@ -217,8 +217,9 @@
do {
prevLine = line;
line = mStream->readLine().trimmed();
- } while ( !mStream->atEnd() && (line[0] == '*' ||
- prevLine[prevLine.length() - 1] == '\\' ));
+ } while ( !mStream->atEnd() &&
+ ( line[0] == '*' ||
+ prevLine.length() > 0 && prevLine[prevLine.length() - 1] == '\\' ) );
if( line[0] != '!' && line[0] != '|' && line[0] != '{' ) {
// this is a filename, expand it