]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s4/torture/rpc: cppcheck: Fix ctunullpointer error
authorNoel Power <noel.power@suse.com>
Fri, 24 May 2019 11:03:09 +0000 (11:03 +0000)
committerNoel Power <npower@samba.org>
Tue, 11 Jun 2019 12:10:17 +0000 (12:10 +0000)
Fixes

source4/torture/rpc/netlogon.c:307: error: ctunullpointer: Null pointer dereference: p <--[cppcheck]

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Gary Lockyer gary@catalyst.net.nz
source4/torture/rpc/netlogon.c

index 52c443e39f3c744369edf83dcd56f04a9c8d6081..94fe4020fa913a0d2b3b9a90f372ba627ecb392a 100644 (file)
@@ -304,7 +304,13 @@ bool test_SetupCredentials3(struct dcerpc_pipe *p, struct torture_context *tctx,
        uint32_t rid;
        const char *machine_name;
        const char *plain_pass;
-       struct dcerpc_binding_handle *b = p->binding_handle;
+       struct dcerpc_binding_handle *b = NULL;
+
+       if (p == NULL) {
+               return false;
+       }
+
+       b = p->binding_handle;
 
        machine_name = cli_credentials_get_workstation(machine_credentials);
        torture_assert(tctx, machine_name != NULL, "machine_name");