(__mktime_internal): Check for year < 70.

This commit is contained in:
Ulrich Drepper 2002-04-04 01:20:17 +00:00
parent ee9b1a7f08
commit 185fbd6b4b

View File

@ -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.