From: helge Date: Thu, 9 Dec 2004 16:45:48 +0000 (+0000) Subject: fixed an issue with future date headers and libFoundation X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=283f28dce54b0aa43c1c78e7f3e277595541708c;p=sope fixed an issue with future date headers and libFoundation git-svn-id: http://svn.opengroupware.org/SOPE/trunk@430 e4a50df8-12e2-0310-a44c-efbce7f8a7e3 --- diff --git a/sope-mime/ChangeLog b/sope-mime/ChangeLog index 35a55a53..8f6174e4 100644 --- a/sope-mime/ChangeLog +++ b/sope-mime/ChangeLog @@ -1,3 +1,8 @@ +2004-12-09 Helge Hess + + * NGMime: fixed an issue with future date headers and libFoundation + (v4.5.204) + 2004-12-03 Helge Hess * NGImap4: fixed an error handler in the Sieve client (v4.5.203) diff --git a/sope-mime/NGMime/ChangeLog b/sope-mime/NGMime/ChangeLog index fb4b383c..5cb01ac9 100644 --- a/sope-mime/NGMime/ChangeLog +++ b/sope-mime/NGMime/ChangeLog @@ -1,3 +1,8 @@ +2004-12-09 Helge Hess + + * NGMimeRFC822DateHeaderFieldParser.m: fix spam mail date header + parsing for libFoundation + 2004-11-13 Helge Hess * NGConcreteMimeType.m: added support for 'reply-type' parameter in diff --git a/sope-mime/NGMime/NGMimeRFC822DateHeaderFieldParser.m b/sope-mime/NGMime/NGMimeRFC822DateHeaderFieldParser.m index f4523d03..291a7269 100644 --- a/sope-mime/NGMime/NGMimeRFC822DateHeaderFieldParser.m +++ b/sope-mime/NGMime/NGMimeRFC822DateHeaderFieldParser.m @@ -362,6 +362,14 @@ static NSTimeZone *parseTimeZone(unsigned char *s, unsigned int len) { else if (year >= 0 && year < 70) // Y2K year += 2000; +#if LIB_FOUNDATION_LIBRARY + if (year > 2030) { + NSLog(@"ERROR(%s): got invalid year in date header %d: '%s'", + __PRETTY_FUNCTION__, year, buf); + year = 2000; /* no choice is good ..., maybe return nil? */ + } +#endif + /* parse hour */ while (!isdigit(*bytes)) { /* go to first digit */ diff --git a/sope-mime/Version b/sope-mime/Version index 1b20d963..cef3b420 100644 --- a/sope-mime/Version +++ b/sope-mime/Version @@ -2,6 +2,6 @@ MAJOR_VERSION:=4 MINOR_VERSION:=5 -SUBMINOR_VERSION:=203 +SUBMINOR_VERSION:=204 # v4.2.149 requires libNGStreams v4.2.34