mhonarc-users

MHonArc 2.1 bug report: years < 1970

1997-10-14 12:01:42
I just fixed a small bug in MHonArc 2.1: if it encounters a "Date:" header
with a year of less than 1970 (i.e., "Date: Thu, 18 Oct 1956 04:37:04 +0000"),
it apparently goes into an infinite loop.  Actually, it looks like
this is a problem with the Perl5.002 "timegm()" and/or "timelocal()"
library functions, but it's easier to fix MHonArc not to tickle the bug
than it is to fix the bug in the Perl library.  Here is the patch:

*** mhtime.pl.orig      Tue May 13 14:35:33 1997
--- mhtime.pl   Tue Oct 14 09:33:26 1997
***************
*** 227,232 ****
--- 227,237 ----
        return ();
      }

+     if ($yr >= 1900 && $yr < 1970) {
+       warn "Warning: Unreasonable year ($yr) in date, using current\n";
+       $yr = (localtime(time))[5];
+     }
+
      # Modify month and weekday for lookup
      $mon =~ tr/A-Z/a-z/;  $wday =~ tr/A-Z/a-z/;

I'm very impressed with MHonArc, by the way; congratulations on building a
great tool!


-Brent

--
Brent Chapman                   Internet/intranet training and consulting,
Brent(_at_)GreatCircle(_dot_)COM                specializing in network design 
and security.
Great Circle Associates,Inc.    Visit us at http://www.greatcircle.com/ 


<Prev in Thread] Current Thread [Next in Thread>