From d6d8ec80f9fc713924df1c9b72ab0491bdf95bde Mon Sep 17 00:00:00 2001 From: Kamen Mazdrashki Date: Thu, 10 Jun 2010 18:21:44 +0300 Subject: s4/test: fix SEGFAULT in test_group_create when rid is NULL Caller of this function may not need group RID and in such case it passes NULL for rid parameter --- source4/torture/libnet/utils.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'source4/torture') diff --git a/source4/torture/libnet/utils.c b/source4/torture/libnet/utils.c index 312b19483f..486f04451b 100644 --- a/source4/torture/libnet/utils.c +++ b/source4/torture/libnet/utils.c @@ -366,6 +366,7 @@ bool test_group_create(struct torture_context *tctx, struct policy_handle *handle, const char *name, uint32_t *rid) { + uint32_t group_rid; struct lsa_String groupname; struct samr_CreateDomainGroup r; struct policy_handle group_handle; @@ -376,7 +377,9 @@ bool test_group_create(struct torture_context *tctx, r.in.name = &groupname; r.in.access_mask = SEC_FLAG_MAXIMUM_ALLOWED; r.out.group_handle = &group_handle; - r.out.rid = rid; + /* use local variable in case caller + * don't care about the group RID */ + r.out.rid = rid ? rid : &group_rid; torture_comment(tctx, "creating group account %s\n", name); -- cgit