[Date Prev][Date Next]
Year mishandling in libraries/libldap/templout.c (ITS#69)
Full_Name: Nick Cuccia
OS: SunOS 4.1.4
Submission from: (NULL) (18.104.22.168)
The macro YEAR(y) in libraries is used to convert the contents of the
tm_year field of a struct tm to a four-digit year. While it succeeds
when tm_year < 100, it incorrectly handles values >= 100.
Note that in the year 2000 and beyond, the value contained in the tm_year
field of SunOS (and most, if not all, other Unix and Unix-like systems)
will be 100 or more. Given the current implementation of YEAR(y), the
gtime() function (which calculates a time_t based when given a struct tm)
will generate incorrect return values after 1/1/2000.
I've placed a patch which fixes this in the URL included below.