[Opendnssec-user] Opendnssec signer Y2K bug?

Yuri Schaeffer yuri at nlnetlabs.nl
Fri Dec 23 13:31:46 UTC 2011


> Not completely sure, but this looks like a valid patch:
> 
> --- util.c.patch        2011-12-23 13:44:21.000000000 +0100
> +++ util.c      2011-12-23 13:44:38.000000000 +0100
> @@ -255,7 +255,7 @@
>         int year = 1970;
>         int new_year;
>  
> -       while (days < 0 || days >= (int64_t) (is_leap_year(year) ? 366 : 365)) {
> +       while (days < 0 || days > (int64_t) (is_leap_year(year) ? 366 : 365)) {
>                 new_year = year + (int) LDNS_DIV(days, 366);
>                 if (year == new_year) {
>                         year += days < 0 ? -1 : 1;

I think this patch is correct. The confusion is that days represent
'days since' rather than 'day of year'




More information about the Opendnssec-user mailing list