str2time endless loop

Markus Gyger (mgyger@itr.ch)
Fri, 17 May 1996 00:19:57 +0200 (MESZ)


Hi,

in libwww-perl-5b13, module HTTP::Date,

    str2time("Wednesday, 31-Dec-69 23:59:59 GMT")

loops forever in Perl 5.002 Time::Local::timegm. Fix:

*** ,Date.pm	Thu May  9 11:19:10 1996
--- Date.pm	Fri May 17 00:05:10 1996
***************
*** 235,241 ****
     # Then we check if the year is acceptable
     return undef if $yr > 99 && $yr < 1970;  # Epoch started in 1970
     # Epoch counter maxes out in year 2038, assuming "time_t" is 32 bit
!    return undef if $yr > 2038;
  
     $yr += 100 if $yr < 70;
     $yr -= 1900 if $yr >= 1900;
--- 235,241 ----
     # Then we check if the year is acceptable
     return undef if $yr > 99 && $yr < 1970;  # Epoch started in 1970
     # Epoch counter maxes out in year 2038, assuming "time_t" is 32 bit
!    return undef if $yr > 2038 || $yr > 38 && $yr < 70;
  
     $yr += 100 if $yr < 70;
     $yr -= 1900 if $yr >= 1900;


Regards,
    Markus