diff --git a/drivers/rtc/rtc-lib.c b/drivers/rtc/rtc-lib.c index 4a3c0f3aab1490feef3111c667d21dcfee4e5e62..a9db79f80951c4b45e2456cb4e911ef95aebd86e 100644 --- a/drivers/rtc/rtc-lib.c +++ b/drivers/rtc/rtc-lib.c @@ -100,6 +100,7 @@ int rtc_valid_tm(struct rtc_time *tm) if (tm->tm_year < 70 || ((unsigned)tm->tm_mon) >= 12 || tm->tm_mday < 1 + || tm->tm_year > (INT_MAX - 1900) || tm->tm_mday > rtc_month_days(tm->tm_mon, tm->tm_year + 1900) || ((unsigned)tm->tm_hour) >= 24 || ((unsigned)tm->tm_min) >= 60