mirror of
https://github.com/postgres/postgres.git
synced 2025-09-11 00:12:06 +03:00
Guard against overflow in make_interval().
The original code did very little to guard against integer or floating point overflow when computing the interval's fields. Detect any such overflows and error out, rather than silently returning bogus results. Joseph Koshakow, reviewed by Ashutosh Bapat and me. Discussion: https://postgr.es/m/CAAvxfHcm1TPwH_zaGWuFoL8pZBestbRZTU6Z%3D-RvAdSXTPbKfg%40mail.gmail.com
This commit is contained in:
@@ -114,6 +114,7 @@ struct pg_itm_in
|
||||
* 30 days.
|
||||
*/
|
||||
#define DAYS_PER_MONTH 30 /* assumes exactly 30 days per month */
|
||||
#define DAYS_PER_WEEK 7
|
||||
#define HOURS_PER_DAY 24 /* assume no daylight savings time changes */
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user