forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitc5ef8ce
committed
Be more paranoid about null return values from libpq status functions.
PQhost() can return NULL in non-error situations, namely when a Unix-socketconnection has been selected by default. That behavior is a tad debatableperhaps, but for the moment we should make sure that psql copes with it.Unfortunately, do_connect() failed to: it could pass a NULL pointer tostrcmp(), resulting in crashes on most platforms. This was reported as asecurity issue by ChenQin of Topsec Security Team, but the consensus ofthe security list is that it's just a garden-variety bug with no securityimplications.For paranoia's sake, I made the keep_password test not trust PQuser orPQport either, even though I believe those will never return NULL givena valid PGconn.Back-patch to all supported branches.1 parent4616619 commitc5ef8ce
1 file changed
+12
-9
lines changedLines changed: 12 additions & 9 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1750 | 1750 |
| |
1751 | 1751 |
| |
1752 | 1752 |
| |
1753 |
| - | |
| 1753 | + | |
| 1754 | + | |
1754 | 1755 |
| |
1755 |
| - | |
1756 |
| - | |
1757 |
| - | |
1758 |
| - | |
1759 |
| - | |
1760 |
| - | |
| 1756 | + | |
| 1757 | + | |
| 1758 | + | |
| 1759 | + | |
| 1760 | + | |
| 1761 | + | |
| 1762 | + | |
| 1763 | + | |
1761 | 1764 |
| |
1762 | 1765 |
| |
1763 | 1766 |
| |
| |||
1769 | 1772 |
| |
1770 | 1773 |
| |
1771 | 1774 |
| |
1772 |
| - | |
1773 |
| - | |
| 1775 | + | |
| 1776 | + | |
1774 | 1777 |
| |
1775 | 1778 |
| |
1776 | 1779 |
| |
|
0 commit comments
Comments
(0)