diff options
Diffstat (limited to 'src/libical/icaltime.c')
-rw-r--r-- | src/libical/icaltime.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/libical/icaltime.c b/src/libical/icaltime.c index 93eebf6c..13213195 100644 --- a/src/libical/icaltime.c +++ b/src/libical/icaltime.c @@ -111,10 +111,13 @@ static icaltime_t make_time(struct tm *tm, int tzm) if (tm->tm_mon < 0 || tm->tm_mon > 11) return ((icaltime_t) - 1); + if (tm->tm_year < 2) + return ((icaltime_t)-1); + #if (SIZEOF_ICALTIME_T == 4) /* check that year specification within range */ - if (tm->tm_year < 70 || tm->tm_year > 138) + if (tm->tm_year > 138) return ((icaltime_t) - 1); /* check for upper bound of Jan 17, 2038 (to avoid possibility of @@ -127,6 +130,11 @@ static icaltime_t make_time(struct tm *tm, int tzm) return ((icaltime_t) - 1); } } +#else + /* We don't support years >= 10000, because the function has not been tested at this range. */ + if (tm->tm_year >= 8100) { + return ((icaltime_t)-1); + } #endif /* SIZEOF_ICALTIME_T */ /* |