From abda9d334796c34afd53b15348d4ed08bdfef913 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 29 Jun 2012 13:30:44 +0200 Subject: s3: Fix Coverity ID 709217 Dereference after null check A few lines before we did check for x != NULL. I think this might fix a potential remote crash. Signed-off-by: Michael Adam Autobuild-User(master): Michael Adam Autobuild-Date(master): Tue Jul 3 15:30:17 CEST 2012 on sn-devel-104 --- source3/smbd/smb2_server.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'source3/smbd') diff --git a/source3/smbd/smb2_server.c b/source3/smbd/smb2_server.c index c7f9129b12..653a038da5 100644 --- a/source3/smbd/smb2_server.c +++ b/source3/smbd/smb2_server.c @@ -1594,8 +1594,16 @@ NTSTATUS smbd_smb2_request_dispatch(struct smbd_smb2_request *req) req->do_signing = false; if (flags & SMB2_HDR_FLAG_SIGNED) { - struct smbXsrv_connection *conn = x->connection; - DATA_BLOB signing_key = x->global->channels[0].signing_key; + struct smbXsrv_connection *conn; + DATA_BLOB signing_key; + + if (x == NULL) { + return smbd_smb2_request_error( + req, NT_STATUS_ACCESS_DENIED); + } + + conn = x->connection; + signing_key = x->global->channels[0].signing_key; if (!NT_STATUS_IS_OK(session_status)) { return smbd_smb2_request_error(req, session_status); -- cgit