ctdbd_conn: don't use uninitialized memory in ctdbd_register_ips()
authorStefan Metzmacher <metze@samba.org>
Thu, 16 Nov 2023 12:29:18 +0000 (13:29 +0100)
committerJule Anger <janger@samba.org>
Sat, 16 Dec 2023 14:29:10 +0000 (14:29 +0000)
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 <metze@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
(cherry picked from commit 240139370aa19f53dd3de0ff468afd994d3bd973)

source3/lib/ctdbd_conn.c

index dd9206b00fd9c37f69ff6c566be95a418aef482c..4382bae54fcfff482b35d0c40c5c3ebf0a8d57c7 100644 (file)
@@ -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));