diff options
author | Slávek Banko <slavek.banko@axis.cz> | 2012-09-26 14:54:22 +0200 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2012-09-26 17:45:52 +0200 |
commit | 9dc91538a908afdd21be11ea3a2b5b3619b0513b (patch) | |
tree | ec2a89c8387226dcb929139d8a5c521bc925d20e /kioslaves/imap4/imapparser.cc | |
parent | e3cb7a61df6fd3f219445033a42bccf110b0bbf8 (diff) | |
download | tdepim-9dc91538a908afdd21be11ea3a2b5b3619b0513b.tar.gz tdepim-9dc91538a908afdd21be11ea3a2b5b3619b0513b.zip |
Fix more SEGV in imapparser
Thanks to Francois Andriot for the patch
This resolves Bug 1235
(cherry picked from commit 590161fd805b5d9c397a5dc192996d13acdbaff6)
Diffstat (limited to 'kioslaves/imap4/imapparser.cc')
-rw-r--r-- | kioslaves/imap4/imapparser.cc | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/kioslaves/imap4/imapparser.cc b/kioslaves/imap4/imapparser.cc index da1052a15..08fd69f6d 100644 --- a/kioslaves/imap4/imapparser.cc +++ b/kioslaves/imap4/imapparser.cc @@ -345,6 +345,7 @@ imapParser::parseUntagged (parseString & result) parseOneWordC(result); // * TQByteArray what = parseLiteral (result); // see whats coming next + if(!what.isEmpty ()) { switch (what[0]) { //the status responses @@ -482,6 +483,7 @@ imapParser::parseUntagged (parseString & result) if (valid) { what = parseLiteral (result); + if(!what.isEmpty ()) { switch (what[0]) { case 'E': @@ -520,10 +522,12 @@ imapParser::parseUntagged (parseString & result) default: break; } + } } } break; } //switch + } } //func @@ -1915,9 +1919,10 @@ TQCString imapParser::parseLiteralC(parseString & inWords, bool relay, bool stop if (!inWords.isEmpty() && inWords[0] == '{') { TQCString retVal; - ulong runLen = inWords.find ('}', 1); - if (runLen > 0) + long srunLen = inWords.find ('}', 1); // Can return -1, so use a signed long + if (srunLen > 0) { + ulong runLen = (ulong)srunLen; bool proper; ulong runLenSave = runLen + 1; TQCString tmpstr(runLen); |