Fixed an IMAP crasher when quotes were present in mail headers

Monotone-Parent: 8e1a3af5628f31703023508d2fb742a933691c15
Monotone-Revision: 3316e8de631c5da2b7ba6c4505fa74b707b80b51

Monotone-Author: ludovic@Sophos.ca
Monotone-Date: 2010-06-23T19:46:51
Monotone-Branch: ca.inverse.sogo
maint-2.0.2
Ludovic Marcotte 2010-06-23 19:46:51 +00:00
parent 633c7be228
commit 87f02a755d
1 changed files with 13 additions and 2 deletions

View File

@ -2984,7 +2984,18 @@ Index: sope-mime/NGImap4/NGImap4ResponseParser.m
if (_la(self, 0) != ')') {
_consume(self,1);
[dict setObject: _parseBodyString(self, YES)
@@ -2170,6 +2475,21 @@
@@ -2090,6 +2395,10 @@
cnt = 0;
str = nil;
while ((c = _la(self, 0)) != _c) {
+ if (c == '\\') {
+ _consume(self, 1);
+ c = _la(self, 0);
+ }
buf[cnt] = c;
_consume(self, 1);
cnt++;
@@ -2170,6 +2479,21 @@
}
}
@ -3006,7 +3017,7 @@ Index: sope-mime/NGImap4/NGImap4ResponseParser.m
- (NSException *)exceptionForFailedMatch:(unsigned char)_match
got:(unsigned char)_avail
{
@@ -2225,9 +2545,9 @@
@@ -2225,9 +2549,9 @@
[s release];
if (c == '\n') {