1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-10 01:18:15 +03:00

s3:smbd: make sure smbXsrv_session_update() doesn't segfault with table == NULL

There might be other places than smb2srv_update_crypto_flags(), which
may call smbXsrv_session_update() with a fake session, they should
return in error instead of segfaulting.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Stefan Metzmacher 2021-07-14 17:15:52 +02:00
parent aa29d89942
commit 1781910df6

View File

@ -1426,6 +1426,13 @@ NTSTATUS smbXsrv_session_update(struct smbXsrv_session *session)
return NT_STATUS_INTERNAL_ERROR;
}
if (table == NULL) {
DEBUG(0, ("smbXsrv_session_update(0x%08x): "
"Called with table == NULL'\n",
session->global->session_global_id));
return NT_STATUS_INTERNAL_ERROR;
}
session->global->db_rec = smbXsrv_session_global_fetch_locked(
table->global.db_ctx,
session->global->session_global_id,