diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2015-11-25 17:31:53 -0500 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2015-11-25 17:31:53 -0500 |
commit | c5ef8ce53d37e276d70593ff0f4b06dd119cd3ff (patch) | |
tree | 79ceb8ee57576c4c1a0dc7662589baef8cf5ec38 /src/backend/access/transam/commit_ts.c | |
parent | 46166197c3b3748c3266c694d7c2f5a312ea928e (diff) | |
download | postgresql-c5ef8ce53d37e276d70593ff0f4b06dd119cd3ff.tar.gz postgresql-c5ef8ce53d37e276d70593ff0f4b06dd119cd3ff.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/access/transam/commit_ts.c')
0 files changed, 0 insertions, 0 deletions