diff options
-rw-r--r-- | camel/ChangeLog | 10 | ||||
-rw-r--r-- | camel/broken-date-parser.c | 6 | ||||
-rw-r--r-- | camel/camel-mime-utils.c | 4 |
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); |