Actions
Bug #12348
opengmtime/localtime erroneously fail EOVERFLOW with the minimum possible input value
Status:
New
Priority:
Normal
Assignee:
-
Category:
lib - userland libraries
Start date:
Due date:
% Done:
0%
Estimated time:
Difficulty:
Tags:
Gerrit CR:
Description
When fed the time_t representing the minimal possible value, we fail because underflow because 'y' ends up with a value one too low, and so we fail EOVERFLOW.
You can reproduce by feeding timegm a `struct tm` with an INT_MIN year.
Updated by Rich Lowe 10 months ago
I was asked about this ages ago, but forgot to provide the awful test case I'd been using.
It's here: https://gist.github.com/richlowe/8a84030dfd360fabd2b508da26a4db06
Actions