Re: Avoid a possible overflow (src/backend/utils/sort/logtape.c) - Mailing list pgsql-hackers

From David Rowley
Subject Re: Avoid a possible overflow (src/backend/utils/sort/logtape.c)
Date
Msg-id CAApHDvp-bhLgS_-gsXAq97s89ypXUZOjCumqvtP+Lpz-x_1u=w@mail.gmail.com
Whole thread Raw
In response to Re: Avoid a possible overflow (src/backend/utils/sort/logtape.c)  (Michael Paquier <michael@paquier.xyz>)
Responses Re: Avoid a possible overflow (src/backend/utils/sort/logtape.c)
List pgsql-hackers
On Fri, 25 Aug 2023 at 13:19, Michael Paquier <michael@paquier.xyz> wrote:
> Still that looks entirely different to me.  Here we have a problem
> where the number of free blocks stored may cause an overflow in the
> internal routine retrieving a free block, but your other thread
> is about long being not enough on Windows.  I surely agree that
> there's an argument for improving this interface and remove its use of
> long in the long-term but that would not be backpatched.  I also don't
> see why we cannot do the change proposed here until then, and it's
> backpatchable.

I agree with this. I think Ranier's patch is good and we should apply
it and backpatch it.

We shouldn't delay fixing this simple bug because we have some future
ambitions to swap the use of longs to int64.

David



pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: PG 16 draft release notes ready
Next
From: Peter Geoghegan
Date:
Subject: Re: Avoid a possible overflow (src/backend/utils/sort/logtape.c)