From 95d6f08ff443471c38e4342daf4915425a9d14e8 Mon Sep 17 00:00:00 2001 From: Ian Barwick Date: Tue, 1 Aug 2017 13:58:40 +0900 Subject: [PATCH] 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. --- repmgr.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/repmgr.c b/repmgr.c index 3ae30bf6..1d9ca5e6 100644 --- a/repmgr.c +++ b/repmgr.c @@ -5946,9 +5946,9 @@ do_witness_create(void) char master_hba_file[MAXLEN]; bool success; - char witness_port[MAXLEN]; - char repmgr_user[MAXLEN]; - char repmgr_db[MAXLEN]; + char witness_port[MAXLEN] = ""; + char repmgr_user[MAXLEN] = ""; + char repmgr_db[MAXLEN] = ""; /* * Extract the repmgr user and database names from the conninfo string