mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-27 03:33:33 +08:00
(__mktime_internal): If year is 69, don't bail out early, but check whether it
overflowed afterwards.
This commit is contained in:
parent
2160bafc81
commit
370846959e
@ -259,8 +259,10 @@ __mktime_internal (struct tm *tp,
|
||||
|
||||
int sec_requested = sec;
|
||||
|
||||
/* Only years after 1970 are defined. */
|
||||
if (year < 70)
|
||||
/* Only years after 1970 are defined.
|
||||
If year is 69, it might still be representable due to
|
||||
timezone differnces. */
|
||||
if (year < 69)
|
||||
return -1;
|
||||
|
||||
#if LEAP_SECONDS_POSSIBLE
|
||||
@ -370,6 +372,14 @@ __mktime_internal (struct tm *tp,
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (year == 69)
|
||||
{
|
||||
/* If year was 69, need to check whether the time was representable
|
||||
or not. */
|
||||
if (t < 0 || t > 2 * 24 * 60 * 60)
|
||||
return -1;
|
||||
}
|
||||
|
||||
*tp = tm;
|
||||
return t;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user