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

Michael Paquier <michael@paquier.xyz>

From: Michael Paquier <michael@paquier.xyz>
To: Ranier Vilela <ranier.vf@gmail.com>
Cc: Pg Hackers <pgsql-hackers@postgresql.org>
Date: 2023-08-24T23:47:39Z
Lists: pgsql-hackers
On Thu, Aug 24, 2023 at 02:46:42PM -0300, Ranier Vilela wrote:
> With Windows both *long* and *int* are 4 bytes.
> But with Linux *long* is 8 bytes and *int* are 4 bytes.

And I recall that WIN32 is the only place where we treat long as 4
bytes.

> patch attached.

Yeah, it looks like you're right here.  Will do something about that.
--
Michael

Commits

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