summaryrefslogtreecommitdiff
path: root/source4/torture
diff options
context:
space:
mode:
authorKamen Mazdrashki <kamenim@samba.org>2010-06-10 18:21:44 +0300
committerKamen Mazdrashki <kamenim@samba.org>2010-06-11 01:20:09 +0300
commitd6d8ec80f9fc713924df1c9b72ab0491bdf95bde (patch)
tree4a094e2b57fc19b1311d1eb3eb32726bcc114d68 /source4/torture
parenteda49261205471a1e0c96ae4e1eda037edb11eba (diff)
downloadsamba-d6d8ec80f9fc713924df1c9b72ab0491bdf95bde.tar.gz
samba-d6d8ec80f9fc713924df1c9b72ab0491bdf95bde.tar.bz2
samba-d6d8ec80f9fc713924df1c9b72ab0491bdf95bde.zip
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
Diffstat (limited to 'source4/torture')
-rw-r--r--source4/torture/libnet/utils.c5
1 files changed, 4 insertions, 1 deletions
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);