mirror of
https://sourceware.org/git/glibc.git
synced 2024-12-13 23:00:22 +00:00
(__mktime_internal): Check for year < 70.
This commit is contained in:
parent
ee9b1a7f08
commit
185fbd6b4b
@ -246,6 +246,10 @@ __mktime_internal (struct tm *tp,
|
||||
int mon_years = mon / 12 - negative_mon_remainder;
|
||||
int year = year_requested + mon_years;
|
||||
|
||||
/* Only years after 1970 are defined. */
|
||||
if (year < 70)
|
||||
return -1;
|
||||
|
||||
/* The other values need not be in range:
|
||||
the remaining code handles minor overflows correctly,
|
||||
assuming int and time_t arithmetic wraps around.
|
||||
|
Loading…
Reference in New Issue
Block a user