summaryrefslogtreecommitdiff
path: root/source4/torture
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2018-09-03 09:55:18 +0200
committerStefan Metzmacher <metze@samba.org>2018-09-05 13:31:41 +0200
commit7276bdb5595fdd2686cc0fde22272d6005e22626 (patch)
tree7a5fb43e14e52a1e3413fbe3834e3291b40b0106 /source4/torture
parent91a5d382bc0baf66a4701901a7e2096071ce1219 (diff)
downloadsamba-7276bdb5595fdd2686cc0fde22272d6005e22626.tar.gz
s4:torture/rpc/netlogon: assert that cli_credentials_get_{workstation,password} don't return NULL
This is better that generating a segfault while dereferencing a NULL pointer later. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11517 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> (cherry picked from commit dffc182c6943d21513d8db9f6cf66bdc09206b17)
Diffstat (limited to 'source4/torture')
-rw-r--r--source4/torture/rpc/netlogon.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/source4/torture/rpc/netlogon.c b/source4/torture/rpc/netlogon.c
index b3dc06de588..e9f2757f53c 100644
--- a/source4/torture/rpc/netlogon.c
+++ b/source4/torture/rpc/netlogon.c
@@ -307,7 +307,9 @@ bool test_SetupCredentials3(struct dcerpc_pipe *p, struct torture_context *tctx,
struct dcerpc_binding_handle *b = p->binding_handle;
machine_name = cli_credentials_get_workstation(machine_credentials);
+ torture_assert(tctx, machine_name != NULL, "machine_name");
plain_pass = cli_credentials_get_password(machine_credentials);
+ torture_assert(tctx, plain_pass != NULL, "plain_pass");
torture_comment(tctx, "Testing ServerReqChallenge\n");
@@ -377,7 +379,9 @@ bool test_SetupCredentialsDowngrade(struct torture_context *tctx,
uint32_t negotiate_flags = 0;
machine_name = cli_credentials_get_workstation(machine_credentials);
+ torture_assert(tctx, machine_name != NULL, "machine_name");
plain_pass = cli_credentials_get_password(machine_credentials);
+ torture_assert(tctx, plain_pass != NULL, "plain_pass");
torture_comment(tctx, "Testing ServerReqChallenge\n");
@@ -1255,7 +1259,9 @@ static bool test_ServerReqChallengeGlobal(struct torture_context *tctx,
struct dcerpc_binding_handle *b2 = NULL;
machine_name = cli_credentials_get_workstation(machine_credentials);
+ torture_assert(tctx, machine_name != NULL, "machine_name");
plain_pass = cli_credentials_get_password(machine_credentials);
+ torture_assert(tctx, plain_pass != NULL, "plain_pass");
torture_comment(tctx, "Testing ServerReqChallenge on b1\n");
@@ -1334,7 +1340,9 @@ static bool test_ServerReqChallengeReuseGlobal(struct torture_context *tctx,
struct dcerpc_binding_handle *b3 = NULL;
machine_name = cli_credentials_get_workstation(machine_credentials);
+ torture_assert(tctx, machine_name != NULL, "machine_name");
plain_pass = cli_credentials_get_password(machine_credentials);
+ torture_assert(tctx, plain_pass != NULL, "plain_pass");
torture_comment(tctx, "Testing ServerReqChallenge on b1\n");
@@ -1429,7 +1437,9 @@ static bool test_ServerReqChallengeReuseGlobal2(struct torture_context *tctx,
struct dcerpc_binding_handle *b2 = NULL;
machine_name = cli_credentials_get_workstation(machine_credentials);
+ torture_assert(tctx, machine_name != NULL, "machine_name");
plain_pass = cli_credentials_get_password(machine_credentials);
+ torture_assert(tctx, plain_pass != NULL, "plain_pass");
torture_comment(tctx, "Testing ServerReqChallenge on b1\n");
@@ -1517,7 +1527,9 @@ static bool test_ServerReqChallengeReuseGlobal3(struct torture_context *tctx,
struct dcerpc_binding_handle *b2 = NULL;
machine_name = cli_credentials_get_workstation(machine_credentials);
+ torture_assert(tctx, machine_name != NULL, "machine_name");
plain_pass = cli_credentials_get_password(machine_credentials);
+ torture_assert(tctx, plain_pass != NULL, "plain_pass");
torture_comment(tctx, "Testing ServerReqChallenge on b1\n");
@@ -1607,7 +1619,9 @@ static bool test_ServerReqChallengeReuseGlobal4(struct torture_context *tctx,
struct dcerpc_binding_handle *b2 = NULL;
machine_name = cli_credentials_get_workstation(machine_credentials);
+ torture_assert(tctx, machine_name != NULL, "machine_name");
plain_pass = cli_credentials_get_password(machine_credentials);
+ torture_assert(tctx, plain_pass != NULL, "plain_pass");
torture_comment(tctx, "Testing ServerReqChallenge on b1\n");
@@ -1722,7 +1736,9 @@ static bool test_ServerReqChallengeReuse(struct torture_context *tctx,
struct dcerpc_binding_handle *b = p->binding_handle;
machine_name = cli_credentials_get_workstation(machine_credentials);
+ torture_assert(tctx, machine_name != NULL, "machine_name");
plain_pass = cli_credentials_get_password(machine_credentials);
+ torture_assert(tctx, plain_pass != NULL, "plain_pass");
torture_comment(tctx, "Testing ServerReqChallenge on b1\n");