Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit50cd651

Browse files
committed
Use the correct sizeof() in BufFileLoadBuffer
The sizeof() call should reference buffer.data, because that's thebuffer we're reading data into, not the whole PGAlignedBuffer union.This was introduced by44cac93, which replaced the simple bufferwith a PGAlignedBuffer field.It's benign, because the buffer is the largest field of the union, sothe sizes are the same. But it's easy to trip over this in a patch, sofix and backpatch. Commit44cac93 went into 12, but that's EOL.Backpatch-through: 13Discussion:https://postgr.es/m/928bdab1-6567-449f-98c4-339cd2203b87@vondra.me
1 parent24c5b73 commit50cd651

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
@@ -459,7 +459,7 @@ BufFileLoadBuffer(BufFile *file)
459459
*/
460460
file->nbytes=FileRead(thisfile,
461461
file->buffer.data,
462-
sizeof(file->buffer),
462+
sizeof(file->buffer.data),
463463
file->curOffset,
464464
WAIT_EVENT_BUFFILE_READ);
465465
if (file->nbytes<0)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp