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

Commit8cedf6a

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 parent4d6e169 commit8cedf6a

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
@@ -452,7 +452,7 @@ BufFileLoadBuffer(BufFile *file)
452452
*/
453453
file->nbytes=FileRead(thisfile,
454454
file->buffer.data,
455-
sizeof(file->buffer),
455+
sizeof(file->buffer.data),
456456
file->curOffset,
457457
WAIT_EVENT_BUFFILE_READ);
458458
if (file->nbytes<0)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp