aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/regexp.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2015-11-25 17:31:54 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2015-11-25 17:31:54 -0500
commit6430a11fa9bc2e56d468283ac73c9c15253ae32e (patch)
treeef0df03b7ffb24f4307cfcaf0091647ff7ce513f /src/backend/utils/adt/regexp.c
parentc36064e438c738fb305919874f22ef1e9b755a63 (diff)
downloadpostgresql-6430a11fa9bc2e56d468283ac73c9c15253ae32e.tar.gz
postgresql-6430a11fa9bc2e56d468283ac73c9c15253ae32e.zip
Be more paranoid about null return values from libpq status functions.
PQhost() can return NULL in non-error situations, namely when a Unix-socket connection has been selected by default. That behavior is a tad debatable perhaps, but for the moment we should make sure that psql copes with it. Unfortunately, do_connect() failed to: it could pass a NULL pointer to strcmp(), resulting in crashes on most platforms. This was reported as a security issue by ChenQin of Topsec Security Team, but the consensus of the security list is that it's just a garden-variety bug with no security implications. For paranoia's sake, I made the keep_password test not trust PQuser or PQport either, even though I believe those will never return NULL given a valid PGconn. Back-patch to all supported branches.
Diffstat (limited to 'src/backend/utils/adt/regexp.c')
0 files changed, 0 insertions, 0 deletions