]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
ctdb-protocol: Initialise request->rdata.opcode where missing
authorMartin Schwenke <martin@meltin.net>
Mon, 23 Sep 2019 06:11:00 +0000 (16:11 +1000)
committerAmitay Isaacs <amitay@samba.org>
Fri, 4 Oct 2019 05:47:35 +0000 (05:47 +0000)
Otherwise it is uninitialised, so...

==22889== Conditional jump or move depends on uninitialised value(s)
==22889==    at 0x12257B: ctdb_req_control_data_len (protocol_control.c:39)
==22889==    by 0x1228E9: ctdb_req_control_len (protocol_control.c:1786)
==22889==    by 0x12A51C: ctdb_client_control_send (client_control.c:101)
==22889==    by 0x138BE1: ctdb_tunnel_setup_send (client_tunnel.c:100)
==22889==    by 0x10EE4F: tunnel_test_send (tunnel_test.c:135)
==22889==    by 0x10EE4F: main (tunnel_test.c:463)

and similar.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/protocol/protocol_client.c

index 9aa32a9bba7c409f421dfc9c39b0bf89cba4954a..a461ff36016126b4c3d19491b721170e1b584c0f 100644 (file)
@@ -2311,6 +2311,8 @@ void ctdb_req_control_tunnel_register(struct ctdb_req_control *request,
        request->srvid = tunnel_id;
        request->client_id = 0;
        request->flags = 0;
+
+       request->rdata.opcode = CTDB_CONTROL_TUNNEL_REGISTER;
 }
 
 int ctdb_reply_control_tunnel_register(struct ctdb_reply_control *reply)
@@ -2332,6 +2334,8 @@ void ctdb_req_control_tunnel_deregister(struct ctdb_req_control *request,
        request->srvid = tunnel_id;
        request->client_id = 0;
        request->flags = 0;
+
+       request->rdata.opcode = CTDB_CONTROL_TUNNEL_DEREGISTER;
 }
 
 int ctdb_reply_control_tunnel_deregister(struct ctdb_reply_control *reply)