pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tomas Vondra <tomas.vondra@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Use the correct sizeof() in BufFileLoadBuffer
Date: Sat, 25 Jan 2025 01:18:05 +0000
Message-ID: <E1tbUoH-003MHr-1X@gemulon.postgresql.org> (raw)

Use the correct sizeof() in BufFileLoadBuffer

The sizeof() call should reference buffer.data, because that's the
buffer we're reading data into, not the whole PGAlignedBuffer union.
This was introduced by 44cac93464, which replaced the simple buffer
with a PGAlignedBuffer field.

It's benign, because the buffer is the largest field of the union, so
the sizes are the same. But it's easy to trip over this in a patch, so
fix and backpatch. Commit 44cac93464 went into 12, but that's EOL.

Backpatch-through: 13
Discussion: https://postgr.es/m/928bdab1-6567-449f-98c4-339cd2203b87@vondra.me

Branch
------
REL_13_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/88d322a160e3e648406ffa692b0988c1b0fe2db8

Modified Files
--------------
src/backend/storage/file/buffile.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)



view thread (6+ messages)

Message-ID: <E1tbUoH-003MHr-1X@gemulon.postgresql.org>
Permalink:  ../E1tbUoH-003MHr-1X@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1tbUoH-003MHr-1X@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: tomas.vondra@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Use the correct sizeof() in BufFileLoadBuffer
  In-Reply-To: <E1tbUoH-003MHr-1X@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox