forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit1b8a953
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 parent8703cde commit1b8a953
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 |
| |
| |||
196 | 197 |
| |
197 | 198 |
| |
198 | 199 |
| |
199 |
| - | |
200 |
| - | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
201 | 207 |
| |
202 |
| - | |
203 |
| - | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
204 | 214 |
| |
205 | 215 |
| |
206 | 216 |
| |
207 | 217 |
| |
208 | 218 |
| |
209 |
| - | |
210 |
| - | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
211 | 222 |
| |
212 |
| - | |
| 223 | + | |
213 | 224 |
| |
214 | 225 |
| |
215 | 226 |
| |
|
0 commit comments
Comments
(0)