s4:torture:base:bench-readwrite: fix uninitialized memory causing segfault
authorAliaksei Karaliou <akaraliou@panasas.com>
Fri, 21 Dec 2018 13:47:00 +0000 (16:47 +0300)
committerJeremy Allison <jra@samba.org>
Tue, 8 Jan 2019 02:40:26 +0000 (03:40 +0100)
Allocation of 'struct smb_composite_connect' happens without zeroing
so that smb_composite_connect_send() thinks that connection
already exists and fails on its handling.

Signed-off-by: Aliaksei Karaliou <akaraliou@panasas.com>
Reviewed-by: Douglas Bagnall <dbagnall@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source4/torture/basic/misc.c

index 25ae456..8b187f8 100644 (file)
@@ -931,8 +931,8 @@ bool run_benchrw(struct torture_context *tctx)
                        switch (state[i]->mode){
                        /*open multiple connections with the same userid */
                        case START:
-                               smb_con = talloc(
-                                       tctx,struct smb_composite_connect) ;
+                               smb_con = talloc_zero(
+                                       tctx,struct smb_composite_connect);
                                state[i]->req_params=smb_con; 
                                state[i]->mode=OPEN_CONNECTION;
                                req1 = torture_connect_async(