From 185fbd6b4b6cfdafb3ad628b56376ef75ec61004 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Thu, 4 Apr 2002 01:20:17 +0000 Subject: [PATCH] (__mktime_internal): Check for year < 70. --- time/mktime.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/time/mktime.c b/time/mktime.c index 5f3f3f23f81..50ab06aba85 100644 --- a/time/mktime.c +++ b/time/mktime.c @@ -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. -- 2.47.2