bdr_sequencer_wakeup() was iterating over BdrSequencerCtl->slots
using bdr_seq_nnodes instead of bdr_seq_nsequencers, which would
cause it to attempt access past the end of the shared memory segment
allocated for BdrSequencerCtl.
if (seq_slot < 0)
return;
+ Assert(seq_slot < bdr_seq_nsequencers);
+
slot = &BdrSequencerCtl->slots[seq_slot];
slot->database_oid = InvalidOid;
bdr_sequencer_shmem_init(int nnodes, int sequencers)
{
Assert(process_shared_preload_libraries_in_progress);
+ Assert(nnodes >= sequencers);
bdr_seq_nnodes = nnodes;
bdr_seq_nsequencers = sequencers;
BdrSequencerSlot *slot;
- for (off = 0; off < bdr_seq_nnodes; off++)
+ for (off = 0; off < bdr_seq_nsequencers; off++)
{
slot = &BdrSequencerCtl->slots[off];