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

Commitdf0a67f

Browse files
committed
Fix incorrect calculation in shm_mq_receive.
If some, but not all, of the length word has already been read, and thenext attempt to read sees exactly the number of bytes needed to completethe length word, or fewer, then we'll incorrectly read less than all ofthe available data.Antonin Houska
1 parent0e141c0 commitdf0a67f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎src/backend/storage/ipc/shm_mq.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,7 @@ shm_mq_receive(shm_mq_handle *mqh, Size *nbytesp, void **datap, bool nowait)
584584
if (mqh->mqh_partial_bytes+rb>sizeof(Size))
585585
lengthbytes=sizeof(Size)-mqh->mqh_partial_bytes;
586586
else
587-
lengthbytes=rb-mqh->mqh_partial_bytes;
587+
lengthbytes=rb;
588588
memcpy(&mqh->mqh_buffer[mqh->mqh_partial_bytes],rawdata,
589589
lengthbytes);
590590
mqh->mqh_partial_bytes+=lengthbytes;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp