From ce5d4f487d12a69f174d546a6bf2d2369eab2a23 Mon Sep 17 00:00:00 2001 From: John Sully Date: Sun, 24 Mar 2019 18:57:25 -0400 Subject: [PATCH] We don't corretly terminate our varargs Former-commit-id: 8bcde757cef67140df2d57777331107010b71940 --- src/replication.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/replication.cpp b/src/replication.cpp index 5c885659d..651680127 100644 --- a/src/replication.cpp +++ b/src/replication.cpp @@ -1819,10 +1819,10 @@ void syncWithMaster(aeEventLoop *el, int fd, void *privdata, int mask) { /* Send UUID */ if (server.repl_state == REPL_STATE_SEND_UUID) { - char szUUID[37]; + char szUUID[37] = {0}; memset(server.master_uuid, 0, UUID_BINARY_LEN); uuid_unparse((unsigned char*)server.uuid, szUUID); - err = sendSynchronousCommand(SYNC_CMD_WRITE,fd,"REPLCONF","uuid",szUUID); + err = sendSynchronousCommand(SYNC_CMD_WRITE,fd,"REPLCONF","uuid",szUUID,NULL); if (err) goto write_error; server.repl_state = REPL_STATE_RECEIVE_UUID; return;