You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2004/12/03 19:54:49 UTC

DO NOT REPLY [Bug 32520] New: - apr_time_exp_[gmt|tz|lt] return neg microseconds for dates < 1970

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=32520>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=32520

           Summary: apr_time_exp_[gmt|tz|lt] return neg microseconds for
                    dates < 1970
           Product: APR
           Version: HEAD
          Platform: Macintosh
        OS/Version: Mac OS X 10.0
            Status: NEW
          Severity: normal
          Priority: P2
         Component: APR
        AssignedTo: bugs@httpd.apache.org
        ReportedBy: carnold@houston.rr.com


Affects Unix implementation does not appear to affect Windows implementation. 
The offending lines are in explode_time in time.c:

    time_t tt = (t / APR_USEC_PER_SEC) + offset;
    xt->tm_usec = t % APR_USEC_PER_SEC;

If t < 0 (that is less than 1 Jan 1970), then modulo will return negative and
time will be rounded forward.

The attached patch adds two tests and adjusts tt and xt->tm_usec if xt->tm_usec
is negative.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org