- Notifications
You must be signed in to change notification settings - Fork28
Commit8048404
committed
Fix bogus initialization of replication origin shared memory state.
The previous coding zeroed out offsetof(ReplicationStateCtl, states)more bytes than it was entitled to, as a consequence of starting thezeroing from the wrong pointer (or, if you prefer, using the wrongcalculation of how much to zero).It's unsurprising that this has not caused any reported problems,since it can be expected that the newly-allocated block is at the endof what we've used in shared memory, and we always make the shmemblock substantially bigger than minimally necessary. Nonetheless,this is wrong and it could bite us someday; plus it's a dangerousmodel for somebody to copy.This dates back to the introduction of this code (commit5aa2350),so back-patch to all supported branches.1 parent36ac359 commit8048404
1 file changed
+9
-3
lines changedLines changed: 9 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
144 | 144 |
| |
145 | 145 |
| |
146 | 146 |
| |
| 147 | + | |
147 | 148 |
| |
| 149 | + | |
148 | 150 |
| |
149 | 151 |
| |
150 | 152 |
| |
| |||
161 | 163 |
| |
162 | 164 |
| |
163 | 165 |
| |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
164 | 170 |
| |
165 | 171 |
| |
166 | 172 |
| |
| |||
476 | 482 |
| |
477 | 483 |
| |
478 | 484 |
| |
479 |
| - | |
| 485 | + | |
480 | 486 |
| |
481 | 487 |
| |
482 | 488 |
| |
| |||
506 | 512 |
| |
507 | 513 |
| |
508 | 514 |
| |
509 |
| - | |
| 515 | + | |
510 | 516 |
| |
511 |
| - | |
| 517 | + | |
512 | 518 |
| |
513 | 519 |
| |
514 | 520 |
| |
|
0 commit comments
Comments
(0)