repmgr: initialise witness connection parameter buffers as empty strings

There's a risk we may be accessing uninitialised memory if any of the
parameters are not supplied.

Addresses GitHub #315.
This commit is contained in:
Ian Barwick
2017-08-01 13:58:40 +09:00
parent 33af998a1e
commit 95d6f08ff4

View File

@@ -5946,9 +5946,9 @@ do_witness_create(void)
char master_hba_file[MAXLEN]; char master_hba_file[MAXLEN];
bool success; bool success;
char witness_port[MAXLEN]; char witness_port[MAXLEN] = "";
char repmgr_user[MAXLEN]; char repmgr_user[MAXLEN] = "";
char repmgr_db[MAXLEN]; char repmgr_db[MAXLEN] = "";
/* /*
* Extract the repmgr user and database names from the conninfo string * Extract the repmgr user and database names from the conninfo string