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 CAEZATCXodYQOFTaCmgs7aw25EgQi8ozsEyzJh9PqGpHfYkdgyg@mail.gmail.com
Whole thread Raw
In response to Re: BUG #18200: Undefined behaviour in interval_div  (Laurenz Albe <laurenz.albe@cybertec.at>)
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 17:23, Laurenz Albe <laurenz.albe@cybertec.at> wrote:
>
> How about the attached fix?
>

I don't think that's sufficient -- interval_div() should have all the
same overflow protections that interval_mul() has, since they're
basically doing the same thing.

However, I don't think that's sufficient either -- looking at
interval_mul(), there is nothing to prevent integer overflow when
cascading down, so additional checks are needed there too (in both
functions).

Regards,
Dean



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: Tom Lane
Date:
Subject: Re: BUG #18196: Databases Created in Turkish Language Will Not Run on the Latest Version of Windows