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

Commitc52ad9c

Browse files
committed
Fix assert in logicalmsg_desc
The assert, introduced by9f1cf97, is intended to check if the prefixis terminated by a \0 byte, but it has two flaws. Firstly, prefix_sizeincludes the \0 byte, so prefix[prefix_size] points to the byte afterthe null byte. Secondly, the check ensures the byte is not equal \0,while it should be checking the opposite.Backpatch-through: 14Discussion:https://postgr.es/m/b99b6101-2f14-3796-3dfa-4a6cd7d4326d@enterprisedb.com
1 parent40ca907 commitc52ad9c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎src/backend/access/rmgrdesc/logicalmsgdesc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ logicalmsg_desc(StringInfo buf, XLogReaderState *record)
2828
char*message=xlrec->message+xlrec->prefix_size;
2929
char*sep="";
3030

31-
Assert(prefix[xlrec->prefix_size]!='\0');
31+
Assert(prefix[xlrec->prefix_size-1]=='\0');
3232

3333
appendStringInfo(buf,"%s, prefix \"%s\"; payload (%zu bytes): ",
3434
xlrec->transactional ?"transactional" :"non-transactional",

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp