From: Volker Lendecke Date: Sun, 29 Dec 2024 10:49:35 +0000 (+0100) Subject: torture4: Simplification with generate_random_str_list_buf() X-Git-Tag: tdb-1.4.13~115 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7b38387e27ccf0183b51ba8a4ba9cd31a4ea85bb;p=thirdparty%2Fsamba.git torture4: Simplification with generate_random_str_list_buf() No NULL check required Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- diff --git a/source4/torture/rpc/samba3rpc.c b/source4/torture/rpc/samba3rpc.c index 84561de7b99..ac394199eab 100644 --- a/source4/torture/rpc/samba3rpc.c +++ b/source4/torture/rpc/samba3rpc.c @@ -2094,7 +2094,7 @@ static bool torture_samba3_rpc_randomauth2(struct torture_context *torture) TALLOC_CTX *mem_ctx; struct dcerpc_pipe *net_pipe; struct dcerpc_binding_handle *net_handle; - char *wksname; + char wksname[15]; bool result = false; NTSTATUS status; struct netr_ServerReqChallenge r; @@ -2112,11 +2112,9 @@ static bool torture_samba3_rpc_randomauth2(struct torture_context *torture) return false; } - if (!(wksname = generate_random_str_list( - mem_ctx, 14, "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"))) { - torture_comment(torture, "generate_random_str_list failed\n"); - goto done; - } + generate_random_str_list_buf(wksname, + sizeof(wksname), + "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"); if (!(torture_open_connection_share( mem_ctx, &cli,