forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitef9bf35
committed
Repair unsafe/unportable snprintf usage in pg_restore.
warn_or_exit_horribly() was blithely passing a potentially-NULLstring pointer to a %s format specifier. That works (at leastto the extent of not crashing) on some platforms, but not all,and since we switched to our own snprintf.c it doesn't workfor us anywhere.Of the three string fields being handled this way here, I thinkthat only "owner" is supposed to be nullable ... but consideringthat this is error-reporting code, it has very little businessassuming anything, so put in defenses for all three.Per a crash observed on buildfarm member crake and thenreproduced here. Because of the portability aspect,back-patch to all supported versions.1 parent027b5a3 commitef9bf35
1 file changed
+5
-2
lines changedLines changed: 5 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1784 | 1784 |
| |
1785 | 1785 |
| |
1786 | 1786 |
| |
1787 |
| - | |
1788 |
| - | |
| 1787 | + | |
| 1788 | + | |
| 1789 | + | |
| 1790 | + | |
| 1791 | + | |
1789 | 1792 |
| |
1790 | 1793 |
| |
1791 | 1794 |
| |
|
0 commit comments
Comments
(0)