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

From: Ranier Vilela <ranier(dot)vf(at)gmail(dot)com>
To: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Avoid a possible overflow (src/backend/utils/sort/logtape.c)
Date: 2023-08-24 17:46:42
Message-ID: CAEudQApLDWCBR_xmwNjGBrDo+f+S4E87x3s7-+hoaKqYdtC4JQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

nFreeBlocks stores the number of free blocks and
your type is *long*.

At Function ltsGetFreeBlock is locally stored in
heapsize wich type is *int*

With Windows both *long* and *int* are 4 bytes.
But with Linux *long* is 8 bytes and *int* are 4 bytes.

patch attached.

best regards,
Ranier Vilela

Attachment Content-Type Size
0001-Avoid-possible-overflow-with-ltsGetFreeBlock-functio.patch application/octet-stream 1.0 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tristan Partin 2023-08-24 18:44:34 Re: Make documentation builds reproducible
Previous Message Nathan Bossart 2023-08-24 17:23:35 Re: add timing information to pg_upgrade