From: Stefan Metzmacher Date: Thu, 16 Nov 2023 12:29:18 +0000 (+0100) Subject: ctdbd_conn: don't use uninitialized memory in ctdbd_register_ips() X-Git-Tag: samba-4.18.10~40 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=24d960d02b84a498cfacc5ee2b283d7bd5b2e1f6;p=thirdparty%2Fsamba.git ctdbd_conn: don't use uninitialized memory in ctdbd_register_ips() We dump the structure into the socket, so we need to zero the content including possible padding. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15523 Signed-off-by: Stefan Metzmacher Reviewed-by: Martin Schwenke (cherry picked from commit 240139370aa19f53dd3de0ff468afd994d3bd973) --- diff --git a/source3/lib/ctdbd_conn.c b/source3/lib/ctdbd_conn.c index dd9206b00fd..4382bae54fc 100644 --- a/source3/lib/ctdbd_conn.c +++ b/source3/lib/ctdbd_conn.c @@ -1144,6 +1144,7 @@ int ctdbd_register_ips(struct ctdbd_connection *conn, smbd_ctdb_canonicalize_ip(_client, &client); smbd_ctdb_canonicalize_ip(_server, &server); + ZERO_STRUCT(p); switch (client.ss_family) { case AF_INET: memcpy(&p.dst.ip, &server, sizeof(p.dst.ip));