Re: BUG #18200: Undefined behaviour in interval_div - Mailing list pgsql-bugs

From Dean Rasheed
Subject Re: BUG #18200: Undefined behaviour in interval_div
Date
Msg-id CAEZATCWar0wEJw_eQudbnpZsyC5VCcJ=hngaUD0ZEWWrm2LGbA@mail.gmail.com
Whole thread Raw
In response to Re: BUG #18200: Undefined behaviour in interval_div  (Dean Rasheed <dean.a.rasheed@gmail.com>)
Responses Re: BUG #18200: Undefined behaviour in interval_div  (Dean Rasheed <dean.a.rasheed@gmail.com>)
List pgsql-bugs
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

Attachment

pgsql-bugs by date:

Previous
From: Halil Han Badem
Date:
Subject: Re: BUG #18196: Databases Created in Turkish Language Will Not Run on the Latest Version of Windows
Next
From: Thomas Munro
Date:
Subject: Re: BUG #18196: Databases Created in Turkish Language Will Not Run on the Latest Version of Windows