Fix more SEGV in imapparser

Thanks to Francois Andriot for the patch
This resolves Bug 1235
(cherry picked from commit 590161fd80)
v3.5.13-sru
Slávek Banko 12 years ago
parent e3cb7a61df
commit 9dc91538a9

@ -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':
@ -522,8 +524,10 @@ imapParser::parseUntagged (parseString & result)
}
}
}
}
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);

Loading…
Cancel
Save