forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit4dbe196
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 parenta391ff3 commit4dbe196
1 file changed
+5
-2
lines changedLines changed: 5 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1793 | 1793 |
| |
1794 | 1794 |
| |
1795 | 1795 |
| |
1796 |
| - | |
1797 |
| - | |
| 1796 | + | |
| 1797 | + | |
| 1798 | + | |
| 1799 | + | |
| 1800 | + | |
1798 | 1801 |
| |
1799 | 1802 |
| |
1800 | 1803 |
| |
|
0 commit comments
Comments
(0)