forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit1d7641d
committed
Fix sscanf limits in pg_basebackup and pg_dump
Make sure that the string parsing is limited by the size of thedestination buffer.In pg_basebackup the available values sent from the serveris limited to two characters so there was no risk of overflow.In pg_dump the buffer is bounded by MAXPGPATH, and thus the limitmust be inserted via preprocessor expansion and the buffer increasedby one to account for the terminator. There is no risk of overflowhere, since in this case, the buffer scanned is smaller than thedestination buffer.Backpatch the pg_basebackup fix to 11 where it was introduced, andthe pg_dump fix all the way down to 9.6.Reviewed-by: Tom LaneDiscussion:https://postgr.es/m/B14D3D7B-F98C-4E20-9459-C122C67647FB@yesql.seBackpatch-through: 11 and 9.61 parentfdd8857 commit1d7641d
File tree
2 files changed
+3
-3
lines changed- src/bin
- pg_basebackup
- pg_dump
2 files changed
+3
-3
lines changedLines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
310 | 310 |
| |
311 | 311 |
| |
312 | 312 |
| |
313 |
| - | |
| 313 | + | |
314 | 314 |
| |
315 | 315 |
| |
316 | 316 |
| |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
449 | 449 |
| |
450 | 450 |
| |
451 | 451 |
| |
452 |
| - | |
| 452 | + | |
453 | 453 |
| |
454 | 454 |
| |
455 | 455 |
| |
456 |
| - | |
| 456 | + | |
457 | 457 |
| |
458 | 458 |
| |
459 | 459 |
| |
|
0 commit comments
Comments
(0)