From 58d938958d3219b1357a7115cbcf9cb6a6f0220f Mon Sep 17 00:00:00 2001 From: Thomas McGuire Date: Tue, 18 Nov 2008 14:26:53 +0000 Subject: [PATCH] Fix possible crash when parsing the procmail file. Patch by George Kiagiadakis , thanks! BUG: 173964 svn path=/trunk/KDE/kdepim/; revision=886055 --- accountdialog.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/accountdialog.cpp b/accountdialog.cpp index e61f054b7..dc5353865 100644 --- a/accountdialog.cpp +++ b/accountdialog.cpp @@ -217,8 +217,9 @@ ProcmailRCParser::processLocalLock(const QString &s) 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