The Samba-Bugzilla – Attachment 13989 Details for
Bug 13282
Zero initialize variables in test_LookupSidsReply()
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for 4.8 cherry-picked from master
bug13282-v48.patch (text/plain), 2.28 KB, created by
Ralph Böhme
on 2018-02-27 10:16:01 UTC
(
hide
)
Description:
Patch for 4.8 cherry-picked from master
Filename:
MIME Type:
Creator:
Ralph Böhme
Created:
2018-02-27 10:16:01 UTC
Size:
2.28 KB
patch
obsolete
>From 30e05d607235edffcde51aafe19707045f300b96 Mon Sep 17 00:00:00 2001 >From: Stefan Metzmacher <metze@samba.org> >Date: Fri, 26 Jan 2018 00:38:32 +0100 >Subject: [PATCH] s4:torture: zero initialize variables in > test_LookupSidsReply() > >This avoids crashes if the server returns unexpected results. The test >should just report the failure in that case. > >Bug: https://bugzilla.samba.org/show_bug.cgi?id=13282 > >Signed-off-by: Stefan Metzmacher <metze@samba.org> >Reviewed-by: Ralph Boehme <slow@samba.org> >(cherry picked from commit 7b86b94c71268cdab434ced74caedcdd5eb20e12) >--- > source4/torture/rpc/lsa_lookup.c | 12 ++++++++---- > 1 file changed, 8 insertions(+), 4 deletions(-) > >diff --git a/source4/torture/rpc/lsa_lookup.c b/source4/torture/rpc/lsa_lookup.c >index 59decda1710..f641827e6dc 100644 >--- a/source4/torture/rpc/lsa_lookup.c >+++ b/source4/torture/rpc/lsa_lookup.c >@@ -329,9 +329,9 @@ bool torture_rpc_lsa_lookup(struct torture_context *torture) > static bool test_LookupSidsReply(struct torture_context *tctx, > struct dcerpc_pipe *p) > { >- struct policy_handle *handle; >+ struct policy_handle *handle = NULL; > >- struct dom_sid **sids; >+ struct dom_sid **sids = NULL; > uint32_t num_sids = 1; > > struct lsa_LookupSids r; >@@ -346,6 +346,10 @@ static bool test_LookupSidsReply(struct torture_context *tctx, > struct dcerpc_binding_handle *b = p->binding_handle; > enum dcerpc_transport_t transport = dcerpc_binding_get_transport(p->binding); > >+ ZERO_STRUCT(r); >+ ZERO_STRUCT(sidarray); >+ ZERO_STRUCT(names); >+ > if (transport != NCACN_NP && transport != NCALRPC) { > torture_comment(tctx, > "test_LookupSidsReply is only available " >@@ -359,7 +363,7 @@ static bool test_LookupSidsReply(struct torture_context *tctx, > > dom_admin_sid = talloc_asprintf(tctx, "%s-%d", dom_sid, 512); > >- sids = talloc_array(tctx, struct dom_sid *, num_sids); >+ sids = talloc_zero_array(tctx, struct dom_sid *, num_sids); > > sids[0] = dom_sid_parse_talloc(tctx, dom_admin_sid); > >@@ -367,7 +371,7 @@ static bool test_LookupSidsReply(struct torture_context *tctx, > names.names = NULL; > > sidarray.num_sids = num_sids; >- sidarray.sids = talloc_array(tctx, struct lsa_SidPtr, num_sids); >+ sidarray.sids = talloc_zero_array(tctx, struct lsa_SidPtr, num_sids); > > for (i=0; i<num_sids; i++) { > sidarray.sids[i].sid = sids[i]; >-- >2.13.6 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Flags:
metze
:
review+
Actions:
View
Attachments on
bug 13282
: 13989