Skip Menu |
 

This queue is for tickets about the Convert-BER CPAN distribution.

Report information
The Basics
Id: 124538
Status: new
Priority: 0/
Queue: Convert-BER

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

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



Subject: timegm should be called with 4-digit year
Download (untitled) / with headers
text/plain 214b
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. Please review/test/merge the attached patch (not tested)
Subject: fix.patch
Download fix.patch
text/x-diff 727b
Index: Convert-BER-1.32/BER.pm =================================================================== --- Convert-BER-1.32.orig/BER.pm +++ Convert-BER-1.32/BER.pm @@ -1874,11 +1874,11 @@ sub unpack { $offset -= ($s - int($s)); } $M -= 1; - if($isgen) { # GeneralizedTime uses 4-digit years - $Y -= 1900; - } - elsif($Y <= 50) { # ASN.1 UTCTime - $Y += 100; # specifies <=50 = 2000..2050, >50 = 1951..1999 + if(!$isgen) { # GeneralizedTime already uses 4-digit years + if($Y <= 50) { # ASN.1 UTCTime + $Y += 100; # specifies <=50 = 2000..2050, >50 = 1951..1999 + } + $Y += 1900; } require Time::Local; $$arg = Time::Local::timegm(int($s),$m,$h,$D,$M,$Y) - $offset;


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.