- Notifications
You must be signed in to change notification settings - Fork4.9k
Commitd54d566
committed
pg_controldata: Fix possible errors on corrupted pg_control
Protect against malformed timestamps. Also protect against negative WalSegSzas it triggers division by zero:((0x100000000UL) / (WalSegSz)) can turn into zero inXLogFileName(xlogfilename, ControlFile->checkPointCopy.ThisTimeLineID, segno, WalSegSz);because if WalSegSz is -1 then by arithmetic rules in C we get0x100000000UL / 0xFFFFFFFFFFFFFFFFUL == 0.Author: Ilyasov Ian <ianilyasov@outlook.com>Author: Anton Voloshin <a.voloshin@postgrespro.ru>Backpatch-through: 131 parente8d8174 commitd54d566
1 file changed
+18
-7
lines changedLines changed: 18 additions & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
97 | 97 |
| |
98 | 98 |
| |
99 | 99 |
| |
| 100 | + | |
100 | 101 |
| |
101 | 102 |
| |
102 | 103 |
| |
| |||
197 | 198 |
| |
198 | 199 |
| |
199 | 200 |
| |
200 |
| - | |
201 |
| - | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
202 | 208 |
| |
203 |
| - | |
204 |
| - | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
205 | 215 |
| |
206 | 216 |
| |
207 | 217 |
| |
208 | 218 |
| |
209 | 219 |
| |
210 |
| - | |
211 |
| - | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
212 | 223 |
| |
213 |
| - | |
| 224 | + | |
214 | 225 |
| |
215 | 226 |
| |
216 | 227 |
| |
|
0 commit comments
Comments
(0)