summaryrefslogtreecommitdiff
path: root/src/libical/icaltime.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libical/icaltime.c')
-rw-r--r--src/libical/icaltime.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/libical/icaltime.c b/src/libical/icaltime.c
index fe03aee5..b8b0f11b 100644
--- a/src/libical/icaltime.c
+++ b/src/libical/icaltime.c
@@ -120,10 +120,13 @@ static time_t make_time(struct tm *tm, int tzm)
if (tm->tm_mon < 0 || tm->tm_mon > 11)
return ((time_t) - 1);
+ if (tm->tm_year < 2)
+ return ((time_t)-1);
+
#if (SIZEOF_TIME_T == 4)
/* check that year specification within range */
- if (tm->tm_year < 70 || tm->tm_year > 138)
+ if (tm->tm_year > 138)
return ((time_t) - 1);
/* check for upper bound of Jan 17, 2038 (to avoid possibility of
@@ -136,6 +139,11 @@ static time_t make_time(struct tm *tm, int tzm)
return ((time_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 ((time_t)-1);
+ }
#endif /* SIZEOF_TIME_T */
/*