Skip Menu |

This queue is for tickets about the Apache-ASP CPAN distribution.

Report information
The Basics
Id: 124555
Status: open
Priority: 0/
Queue: Apache-ASP

People
Owner: Nobody in particular
Requestors: bitcardbmw [...] lsmod.de
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 2.62
Fixed in: (no value)



Subject: timegm should be called with 4-digit year
man Time::Local says Whenever possible, use an absolute four digit year instead. With a detailed explanation about ambiguity of 2-digit years above that. Also, dont fail after 2038, because we have 64bit systems now. Please review/test/merge the attached patch (not tested)
From: bitcardbmw [...] lsmod.de
added forgotten patch
Subject: fix.patch
Index: Apache-ASP-2.62/lib/Apache/ASP/Date.pm =================================================================== --- Apache-ASP-2.62.orig/lib/Apache/ASP/Date.pm +++ Apache-ASP-2.62/lib/Apache/ASP/Date.pm @@ -167,15 +167,15 @@ sub str2time ($;$) # Then we check if the year is acceptable return undef if $yr > 99 && $yr < 1900; # We ignore these years $yr += 100 if $yr < 50; # a stupid thing to do??? - $yr -= 1900 if $yr >= 1900; - # The $yr is now relative to 1900 (as expected by timelocal()) + $yr += 1900 if $yr < 1000; + # The $yr is now absolute 4-digit (as expected by timelocal()) # timelocal() seems to go into an infinite loop if it is given out # of range parameters. Let's check the year at least. - # Epoch counter maxes out in year 2038, assuming "time_t" is 32 bit - return undef if $yr > 138; - return undef if $yr < 70; # 1970 is Unix epoch + # 32bit epoch counter maxes out in year 2038, but "time_t" is 64 bit on most systems now + #return undef if $yr > 2038; + return undef if $yr < 1970; # 1970 is Unix epoch # Compensate for AM/PM if ($aorp) {
Subject: Re: [rt.cpan.org #124555] timegm should be called with 4-digit year
Date: Thu, 15 Mar 2018 22:56:27 -0700
To: bug-Apache-ASP [...] rt.cpan.org
From: Josh Chamas <josh [...] chamas.com>
Thank you for this bug report and patch! Its good to get future proof here. This code was taken from HTTP::Date before it was unbundled from libwww-perl, so I will start using that module directly and add the dependency in the next release 2.65. Thanks again! Josh On 2/23/18 7:43 AM, Bernhard M. W. via RT wrote: Show quoted text
> Queue: Apache-ASP > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=124555 > > > added forgotten patch >