Re: BUG #18200: Undefined behaviour in interval_div
Dean Rasheed <dean.a.rasheed@gmail.com>
From: Dean Rasheed <dean.a.rasheed@gmail.com>
To: Laurenz Albe <laurenz.albe@cybertec.at>
Cc: exclusion@gmail.com, pgsql-bugs@lists.postgresql.org
Date: 2023-11-15T22:41:01Z
Lists: pgsql-bugs
Attachments
- detect-interval-mul-div-overflow.patch (text/x-patch) patch
On Wed, 15 Nov 2023 at 18:14, Dean Rasheed <dean.a.rasheed@gmail.com> wrote: > > looking at > interval_mul(), there is nothing to prevent integer overflow when > cascading down, so additional checks are needed there too (in both > functions). > Here's a patch doing that. I'm inclined to back-patch this, because this seems like something that's quite easily triggered, and returning bogus results is not good. Regards, Dean
Commits
-
Guard against overflow in interval_mul() and interval_div().
- f499d2b20b42 12.18 landed
- 428770aadca9 13.14 landed
- 2ffcebdba4cf 14.11 landed
- 2851aa7d1fc3 15.6 landed
- 72d0c135bd7a 16.2 landed
- b218fbb7a35f 17.0 landed