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

Commite72f211

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 parent543e205 commite72f211

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
@@ -488,7 +488,7 @@ shm_mq_receive(shm_mq_handle *mqh, Size *nbytesp, void **datap, bool nowait)
488488
if (mqh->mqh_partial_bytes+rb>sizeof(Size))
489489
lengthbytes=sizeof(Size)-mqh->mqh_partial_bytes;
490490
else
491-
lengthbytes=rb-mqh->mqh_partial_bytes;
491+
lengthbytes=rb;
492492
memcpy(&mqh->mqh_buffer[mqh->mqh_partial_bytes],rawdata,
493493
lengthbytes);
494494
mqh->mqh_partial_bytes+=lengthbytes;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp