Fix null pointer dereference in "\c" psql command.

Noah Misch <noah@leadboat.com>

Commit: 5f173a9f2a9726c3be9f47eb2081ec4b089bf046
Author: Noah Misch <noah@leadboat.com>
Date: 2015-07-09T00:44:27Z
Releases: 9.1.19
Fix null pointer dereference in "\c" psql command.

The psql crash happened when no current connection existed.  (The second
new check is optional given today's undocumented NULL argument handling
in PQhost() etc.)  Back-patch to 9.0 (all supported versions).

Files

PathChange+/−
src/bin/psql/command.c modified +4 −2