summaryrefslogtreecommitdiff
path: root/source4/torture/rpc
diff options
context:
space:
mode:
authorMatthieu Patou <mat@matws.net>2013-05-17 07:19:22 -0700
committerAndrew Bartlett <abartlet@samba.org>2013-05-20 21:54:06 +1000
commitd42a31d68f3154651f31618f74e2df77084f12f3 (patch)
treefd59bdfa8423447402013350b0cf4b9526ea8dce /source4/torture/rpc
parentd5b440fa897ace7bef4d02a7ad1af556819139a6 (diff)
downloadsamba-d42a31d68f3154651f31618f74e2df77084f12f3.tar.gz
samba-d42a31d68f3154651f31618f74e2df77084f12f3.tar.bz2
samba-d42a31d68f3154651f31618f74e2df77084f12f3.zip
smbtorture: fix crash when the returning a crackname with an empty name
when a valid one was expected Signed-off-by: Matthieu Patou <mat@matws.net> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source4/torture/rpc')
-rw-r--r--source4/torture/rpc/drsuapi_cracknames.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/source4/torture/rpc/drsuapi_cracknames.c b/source4/torture/rpc/drsuapi_cracknames.c
index 8d1ab6fc27..82c9a38af4 100644
--- a/source4/torture/rpc/drsuapi_cracknames.c
+++ b/source4/torture/rpc/drsuapi_cracknames.c
@@ -956,9 +956,25 @@ bool test_DsCrackNames(struct torture_context *tctx,
comment);
torture_fail(tctx, err_msg);
}
+ } else if (crack[i].expected_str &&
+ (!r.out.ctr->ctr1->count ||
+ !r.out.ctr->ctr1->array[0].result_name))
+ {
+ if (!r.out.ctr->ctr1->count) {
+ err_msg = talloc_asprintf(mem_ctx,
+ "DsCrackNames failed - got 0 entries, expected %s on %s",
+ crack[i].expected_str, comment);
+ torture_fail(tctx, err_msg);
+ } else {
+ err_msg = talloc_asprintf(mem_ctx,
+ "DsCrackNames failed - got NULL pointer, expected %s on %s",
+ crack[i].expected_str, comment);
+ torture_fail(tctx, err_msg);
+ }
} else if (crack[i].expected_str
&& (strcmp(r.out.ctr->ctr1->array[0].result_name,
- crack[i].expected_str) != 0)) {
+ crack[i].expected_str) != 0))
+ {
if (strcasecmp(r.out.ctr->ctr1->array[0].result_name,
crack[i].expected_str) != 0) {
err_msg = talloc_asprintf(mem_ctx,