From ae893c4fdd81f3630ce352210c813ceec248be7b Mon Sep 17 00:00:00 2001 From: Steven Dake Date: Wed, 15 Feb 2006 02:02:55 +0000 Subject: [PATCH] enhancement 1049 Patch from Patrick This simple patch stops a potential DoS. If a library tries to access a component that is not loaded into the exec then it will crash trying to deref ais_service_handlers[ service ] git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@924 fd59a12c-fef9-0310-b244-a6a79926bd2f --- exec/main.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/exec/main.c b/exec/main.c index fd04a908..dcd110af 100644 --- a/exec/main.c +++ b/exec/main.c @@ -562,7 +562,10 @@ static int dispatch_init_send_response (struct conn_info *conn_info, void *messa if (conn_info->authenticated) { conn_info->service = req_lib_dispatch_init->resdis_header.service; - error = SA_AIS_OK; + if (!ais_service_handlers[req_lib_dispatch_init->resdis_header.service]) + error = SA_AIS_ERR_NOT_SUPPORTED; + else + error = SA_AIS_OK; conn_info->conn_info_partner = (struct conn_info *)req_lib_dispatch_init->conn_info;