From e84910d919e02feab2a297fccbbf95f333e32119 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 26 Nov 2019 12:46:16 -0800 Subject: [PATCH] s3: smbd: Ensure we exit if supported_protocols[protocol].proto_reply_fn() fails. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14205 Signed-off-by: Jeremy Allison Reviewed-by: Volker Lendecke --- source3/smbd/negprot.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/source3/smbd/negprot.c b/source3/smbd/negprot.c index 3b2555e3d21..8317dc49086 100644 --- a/source3/smbd/negprot.c +++ b/source3/smbd/negprot.c @@ -580,6 +580,7 @@ void reply_negprot(struct smb_request *req) bool signing_required = true; int max_proto; int min_proto; + NTSTATUS status; START_PROFILE(SMBnegprot); @@ -768,7 +769,11 @@ void reply_negprot(struct smb_request *req) fstrcpy(remote_proto,supported_protocols[protocol].short_name); reload_services(sconn, conn_snum_used, true); - supported_protocols[protocol].proto_reply_fn(req, choice); + status = supported_protocols[protocol].proto_reply_fn(req, choice); + if (!NT_STATUS_IS_OK(status)) { + exit_server_cleanly("negprot function failed\n"); + } + DEBUG(3,("Selected protocol %s\n",supported_protocols[protocol].proto_name)); DBG_INFO("negprot index=%zu\n", choice);