[Bug 145341] localtime(3) doesn't handle overflow
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sun, 10 Aug 2025 14:50:09 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=145341
Wolfram Schneider <wosch@FreeBSD.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|Open |In Progress
CC| |wosch@FreeBSD.org
--- Comment #5 from Wolfram Schneider <wosch@FreeBSD.org> ---
I cannot reproduce this error on a 64 bit system running -current or stable/14.
With a time_t value of 67768036191676800 the gmtime function will return NULL
due the year overflow and set the errno value to 84.
time_t: 67768036191676799 time_t size in bytes: 8
t:67768036191676798, tp: 0x822c4b710 errno:0
sec: 58, min:59, hour:23, mday:31, mon:11, year:2147483647,
wday:3, yday:364, isdst:0, gmtoff: 0, zone: UTC
t:67768036191676799, tp: 0x822c4b710 errno:0
sec: 59, min:59, hour:23, mday:31, mon:11, year:2147483647,
wday:3, yday:364, isdst:0, gmtoff: 0, zone: UTC
t:67768036191676800, tp: 0x0 errno:84
--
You are receiving this mail because:
You are the assignee for the bug.