Re: Avoid a possible overflow (src/backend/utils/sort/logtape.c)

Peter Geoghegan <pg@bowt.ie>

From: Peter Geoghegan <pg@bowt.ie>
To: David Rowley <dgrowleyml@gmail.com>
Cc: Michael Paquier <michael@paquier.xyz>, Ranier Vilela <ranier.vf@gmail.com>, Pg Hackers <pgsql-hackers@postgresql.org>
Date: 2023-08-25T02:02:40Z
Lists: pgsql-hackers
On Thu, Aug 24, 2023 at 6:44 PM David Rowley <dgrowleyml@gmail.com> wrote:
> I agree with this. I think Ranier's patch is good and we should apply
> it and backpatch it.

FWIW I'm pretty sure that it's impossible to run into problems here in
practice -- the minheap is allocated by palloc(), and the high
watermark number of free pages is pretty small. Even still, I agree
with your conclusion. There is really no reason to not be consistent
here.

-- 
Peter Geoghegan



Commits

  1. Avoid possible overflow with ltsGetFreeBlock() in logtape.c