[evolution-patches] fix for bug #42045



stupid lame-arsed mailer is sending:

Date: Tue, 29 Apr 2003 13:50:51 359500

so Evolution is using '359500' as the timezone offset and getting a
completely bogus date.

my patch just makes sure the tzone is between -1200 and 1200, if it's
not, then we ignore the timezone token.

Jeff

-- 
Jeffrey Stedfast
Evolution Hacker - Ximian, Inc.
fejj ximian com  - www.ximian.com
? 42045.patch
? ChangeLog.nonximian
? body
? body.c
? body.txt
? camel-mime-filter-windows.c
? camel-mime-filter-windows.h
? charset-map.c
? charset-map.diff
? cmsutil.c
? date.patch
? debug.patch
? evolution-1.3-gpg.patch
? folder-info-build.patch
? foo
? gpg-verify.patch
? gpg.patch
? html-filter-broken.msg
? imap
? invalid-content-id.patch
? iso
? iso.c
? pop3-uidl.patch
? smime
? win-charset.patch
? tests/mime-filter/test-tohtml
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/camel/ChangeLog,v
retrieving revision 1.1805
diff -u -r1.1805 ChangeLog
--- ChangeLog	24 Apr 2003 17:41:26 -0000	1.1805
+++ ChangeLog	1 May 2003 17:43:25 -0000
@@ -1,3 +1,13 @@
+2003-05-01  Jeffrey Stedfast  <fejj ximian com>
+
+	Workaround for POS mailers like the one in bug #42045.
+
+	* camel-mime-utils.c (header_decode_date): Make sure the numeric
+	timezone is between -1200 and 1200, otherwise it is invalid.
+
+	* broken-date-parser.c (get_tzone): Make sure the numeric timezone
+	is between -1200 and 1200, otherwise it is invalid.
+
 2003-04-22  Jeffrey Stedfast  <fejj ximian com>
 
 	* providers/imap/camel-imap-utils.c: Disable debugging printfs.
Index: broken-date-parser.c
===================================================================
RCS file: /cvs/gnome/evolution/camel/broken-date-parser.c,v
retrieving revision 1.10
diff -u -r1.10 broken-date-parser.c
--- broken-date-parser.c	3 Dec 2002 18:23:17 -0000	1.10
+++ broken-date-parser.c	1 May 2003 17:43:26 -0000
@@ -291,7 +291,11 @@
 		inend = inptr + inlen;
 		
 		if (*inptr == '+' || *inptr == '-') {
-			return decode_int (inptr, inlen);
+			t = decode_int (inptr, inlen);
+			if (t < -1200 || t > 1200)
+				return -1;
+			
+			return t;
 		} else {
 			if (*inptr == '(') {
 				inptr++;
Index: camel-mime-utils.c
===================================================================
RCS file: /cvs/gnome/evolution/camel/camel-mime-utils.c,v
retrieving revision 1.181
diff -u -r1.181 camel-mime-utils.c
--- camel-mime-utils.c	27 Mar 2003 20:16:57 -0000	1.181
+++ camel-mime-utils.c	1 May 2003 17:43:26 -0000
@@ -3506,9 +3506,13 @@
 		offset = (*inptr++)=='-'?-1:1;
 		offset = offset * header_decode_int(&inptr);
 		d(printf("abs signed offset = %d\n", offset));
+		if (offset < -1200 || offset > 1200)
+			offset = 0;
 	} else if (isdigit(*inptr)) {
 		offset = header_decode_int(&inptr);
 		d(printf("abs offset = %d\n", offset));
+		if (offset < -1200 || offset > 1200)
+			offset = 0;
 	} else {
 		char *tz = decode_token(&inptr);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]