Re: BUG #18200: Undefined behaviour in interval_div

From: Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>
To: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
Cc: exclusion(at)gmail(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #18200: Undefined behaviour in interval_div
Date: 2023-11-15 18:14:41
Message-ID: CAEZATCXodYQOFTaCmgs7aw25EgQi8ozsEyzJh9PqGpHfYkdgyg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Wed, 15 Nov 2023 at 17:23, Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2023-11-15 18:26:05 Re: BUG #18196: Databases Created in Turkish Language Will Not Run on the Latest Version of Windows
Previous Message Halil Han Badem 2023-11-15 18:11:32 Re: BUG #18196: Databases Created in Turkish Language Will Not Run on the Latest Version of Windows