diff options
Diffstat (limited to 'sql/sql_time.cc')
-rw-r--r-- | sql/sql_time.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sql/sql_time.cc b/sql/sql_time.cc index 2c4998fdf5e..9b68aba5b30 100644 --- a/sql/sql_time.cc +++ b/sql/sql_time.cc @@ -921,6 +921,9 @@ bool date_add_interval(MYSQL_TIME *ltime, interval_type int_type, my_bool neg= 0; enum enum_mysql_timestamp_type time_type= ltime->time_type; + if ((ulong) interval.day > MAX_DAY_NUMBER) + goto invalid_date; + if (time_type != MYSQL_TIMESTAMP_TIME) ltime->day+= calc_daynr(ltime->year, ltime->month, 1) - 1; |