aboutsummaryrefslogtreecommitdiffstats
path: root/camel
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2003-05-03 01:37:11 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2003-05-03 01:37:11 +0800
commitc56bdc1cefc7de7b5c50b751aeafa9083aee18e3 (patch)
tree6b430216c88647e6ba0fef931eb51d13b66d0f4e /camel
parent8a9ec3432ed901063bfe665221cced3be6353015 (diff)
downloadgsoc2013-evolution-c56bdc1cefc7de7b5c50b751aeafa9083aee18e3.tar.gz
gsoc2013-evolution-c56bdc1cefc7de7b5c50b751aeafa9083aee18e3.tar.zst
gsoc2013-evolution-c56bdc1cefc7de7b5c50b751aeafa9083aee18e3.zip
Workaround for POS mailers like the one in bug #42045.
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. svn path=/trunk/; revision=21048
Diffstat (limited to 'camel')
-rw-r--r--camel/ChangeLog10
-rw-r--r--camel/broken-date-parser.c6
-rw-r--r--camel/camel-mime-utils.c4
3 files changed, 19 insertions, 1 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index bc5794ddc5..50d0a158de 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -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-29 Dan Winship <danw@ximian.com>
* Makefile.am (camel_lock_helper_SOURCES): Remove camel-lock.c
diff --git a/camel/broken-date-parser.c b/camel/broken-date-parser.c
index f6e697896c..7dcdf1e61e 100644
--- a/camel/broken-date-parser.c
+++ b/camel/broken-date-parser.c
@@ -291,7 +291,11 @@ get_tzone (struct _date_token **token)
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++;
diff --git a/camel/camel-mime-utils.c b/camel/camel-mime-utils.c
index 6ba498ffa9..907d61b5de 100644
--- a/camel/camel-mime-utils.c
+++ b/camel/camel-mime-utils.c
@@ -3506,9 +3506,13 @@ header_decode_date(const char *in, int *saveoffset)
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);