netlogon:schannel: Fix NULL pointer dereference
authorJoseph Sutton <josephsutton@catalyst.net.nz>
Tue, 2 May 2023 02:48:25 +0000 (14:48 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 18 May 2023 01:03:37 +0000 (01:03 +0000)
We should not pass a NULL pointer into netlogon_creds_client_init().

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source4/librpc/rpc/dcerpc_schannel.c

index 35395ffd214f3f095413508d80b5fc1437c5fc38..244c39a9c902427bf35bd02a7a7a870f796b8f55 100644 (file)
@@ -173,6 +173,9 @@ static void continue_srv_challenge(struct tevent_req *subreq)
 
        /* prepare credentials for auth2 request */
        s->mach_pwd = cli_credentials_get_nt_hash(s->credentials, c);
+       if (s->mach_pwd == NULL) {
+               return composite_error(c, NT_STATUS_INTERNAL_ERROR);
+       }
 
        /* auth2 request arguments */
        s->a.in.server_name      = s->r.in.server_name;