Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 03f8e9a

Browse files
committed
Fix incorrect assertion in libpqwalreceiver
Was supposed to check the length of the array, but was checking its size in bytes. Author: Jacob Brazeal <[email protected]> Discussion: https://www.postgresql.org/message-id/CA%2BCOZaA_9afJxj9ZuO73U5P7WXP%2BZM9NGnZvTDCmBFz0FGP%[email protected]
1 parent 2a943af commit 03f8e9a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/backend/replication/libpqwalreceiver/libpqwalreceiver.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ libpqrcv_connect(const char *conninfo, bool replication, bool logical,
208208
keys[++i] = NULL;
209209
vals[i] = NULL;
210210

211-
Assert(i < sizeof(keys));
211+
Assert(i < lengthof(keys));
212212

213213
conn = palloc0(sizeof(WalReceiverConn));
214214
conn->streamConn = PQconnectStartParams(keys, vals,

0 commit comments

Comments
 (0)