From: Andreas Schneider Date: Mon, 8 Jul 2024 09:39:28 +0000 (+0200) Subject: s4:torture: Do not set sr.in.info to info be we queried the info X-Git-Tag: tdb-1.4.11~121 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=85d80240ec73d5fddd2e254ee142d06fe096f133;p=thirdparty%2Fsamba.git s4:torture: Do not set sr.in.info to info be we queried the info `sr.in.info = info` is correctly set later after we called dcerpc_lsa_QueryTrustedDomainInfoByName_r() which filling the info pointer with data. "Error: UNINIT (CWE-457): samba-4.20.0rc2/source4/torture/rpc/forest_trust.c:211: var_decl: Declaring variable ""info"" without initializer. samba-4.20.0rc2/source4/torture/rpc/forest_trust.c:248: uninit_use: Using uninitialized value ""info"". 246| sr.in.trusted_domain = talloc_zero(tctx, struct lsa_String); 247| sr.in.trusted_domain->string = name; 248|-> sr.in.info = info; 249| 250| for (c = 0; il[c].info_level != -1; c++) {" Signed-off-by: Andreas Schneider Reviewed-by: Guenther Deschner Autobuild-User(master): Günther Deschner Autobuild-Date(master): Tue Jul 16 12:42:39 UTC 2024 on atb-devel-224 --- diff --git a/source4/torture/rpc/forest_trust.c b/source4/torture/rpc/forest_trust.c index 1bd506204b2..8161853b5a4 100644 --- a/source4/torture/rpc/forest_trust.c +++ b/source4/torture/rpc/forest_trust.c @@ -236,7 +236,7 @@ static bool get_and_set_info(struct dcerpc_pipe *p, NTSTATUS status; struct lsa_QueryTrustedDomainInfoByName qr; struct lsa_SetTrustedDomainInfoByName sr; - union lsa_TrustedDomainInfo *info; + union lsa_TrustedDomainInfo *info = NULL; struct lsa_Close cr; struct policy_handle closed_handle; size_t c; @@ -273,7 +273,6 @@ static bool get_and_set_info(struct dcerpc_pipe *p, sr.in.handle = handle; sr.in.trusted_domain = talloc_zero(tctx, struct lsa_String); sr.in.trusted_domain->string = name; - sr.in.info = info; for (c = 0; il[c].info_level != -1; c++) { torture_comment(tctx, "\nGetting/Setting dom info [%d]\n",il[c].info_level);