Avoid null pointer dereference if error result lacks SQLSTATE.
authorTom Lane <[email protected]>
Sun, 1 Nov 2020 16:26:16 +0000 (11:26 -0500)
committerTom Lane <[email protected]>
Sun, 1 Nov 2020 16:26:52 +0000 (11:26 -0500)
commit29ae4cd82949843d09aa02a8125a5b5087201431
tree1c2a2976b49015e5c1e5c2afdf8f877207027444
parentaff06436caf844877f99d32346b076a480e582a7
Avoid null pointer dereference if error result lacks SQLSTATE.

Although error results received from the backend should always have
a SQLSTATE field, ones generated by libpq won't, making this code
vulnerable to a crash after, say, untimely loss of connection.
Noted by Coverity.

Oversight in commit 403a3d91c.  Back-patch to 9.5, as that was.
src/bin/pg_dump/pg_backup_db.c