s4:rpc_server: allow a NULL function pointer in dcesrv_fetch_session_key()
authorStefan Metzmacher <metze@samba.org>
Thu, 8 Nov 2018 08:45:15 +0000 (09:45 +0100)
committerJeremy Allison <jra@samba.org>
Sat, 12 Jan 2019 02:13:33 +0000 (03:13 +0100)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=7113
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11892

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source4/rpc_server/dcerpc_server.c

index fca6229..b8255ba 100644 (file)
@@ -489,7 +489,14 @@ _PUBLIC_ NTSTATUS dcesrv_auth_session_key(struct dcesrv_call_state *call,
 _PUBLIC_ NTSTATUS dcesrv_fetch_session_key(struct dcesrv_connection *p,
                                  DATA_BLOB *session_key)
 {
-       NTSTATUS status = p->auth_state.session_key(p, session_key);
+       struct dcesrv_auth *auth = &p->auth_state;
+       NTSTATUS status;
+
+       if (auth->session_key == NULL) {
+               return NT_STATUS_NO_USER_SESSION_KEY;
+       }
+
+       status = auth->session_key(p, session_key);
        if (!NT_STATUS_IS_OK(status)) {
                return status;
        }