- Notifications
You must be signed in to change notification settings - Fork4.9k
Commit3d357b4
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 parentf91c4e3 commit3d357b4
1 file changed
+13
-10
lines changedLines changed: 13 additions & 10 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1623 | 1623 |
| |
1624 | 1624 |
| |
1625 | 1625 |
| |
1626 |
| - | |
1627 |
| - | |
| 1626 | + | |
| 1627 | + | |
| 1628 | + | |
1628 | 1629 |
| |
1629 |
| - | |
1630 |
| - | |
1631 |
| - | |
1632 |
| - | |
1633 |
| - | |
1634 |
| - | |
| 1630 | + | |
| 1631 | + | |
| 1632 | + | |
| 1633 | + | |
| 1634 | + | |
| 1635 | + | |
| 1636 | + | |
| 1637 | + | |
1635 | 1638 |
| |
1636 | 1639 |
| |
1637 | 1640 |
| |
| |||
1643 | 1646 |
| |
1644 | 1647 |
| |
1645 | 1648 |
| |
1646 |
| - | |
1647 |
| - | |
| 1649 | + | |
| 1650 | + | |
1648 | 1651 |
| |
1649 | 1652 |
| |
1650 | 1653 |
| |
|
0 commit comments
Comments
(0)