Skip to content

Commit fb60050

Browse files
committed
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 44cac93, 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 44cac93 went into 12, but that's EOL. Backpatch-through: 13 Discussion: https://postgr.es/m/928bdab1-6567-449f-98c4-339cd2203b87@vondra.me
1 parent 63a4b9f commit fb60050

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/backend/storage/file/buffile.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ BufFileLoadBuffer(BufFile *file)
434434
thisfile = file->files[file->curFile];
435435
file->nbytes = FileRead(thisfile,
436436
file->buffer.data,
437-
sizeof(file->buffer),
437+
sizeof(file->buffer.data),
438438
file->curOffset,
439439
WAIT_EVENT_BUFFILE_READ);
440440
if (file->nbytes < 0)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy