/[Apache-SVN]/spamassassin/branches/3.0/lib/Mail/SpamAssassin/Util.pm
ViewVC logotype

Diff of /spamassassin/branches/3.0/lib/Mail/SpamAssassin/Util.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

--- spamassassin/branches/3.0/lib/Mail/SpamAssassin/Util.pm	2005/05/19 23:36:34	171014
+++ spamassassin/branches/3.0/lib/Mail/SpamAssassin/Util.pm	2005/05/19 23:37:09	171015
@@ -387,6 +387,17 @@ sub parse_rfc822_date {
 
   $hh ||= 0; $mm ||= 0; $ss ||= 0; $dd ||= 0; $mmm ||= 0; $yyyy ||= 0;
 
+  # Time::Local (v1.10 at least) throws warnings when the dates cause
+  # a 32-bit overflow.  So force a min/max for year.
+  if ($yyyy > 2037) {
+    dbg("util: forcing year to 2037: $date");
+    $yyyy=2037;
+  }
+  elsif ($yyyy < 1970) {
+    dbg("util: forcing year to 1970: $date");
+    $yyyy=1970;
+  }
+
   my $time;
   eval {		# could croak
     $time = timegm($ss, $mm, $hh, $dd, $mmm-1, $yyyy);

 

infrastructure at apache.org
ViewVC Help
Powered by ViewVC 1.1.26