From 456c5b5fd86f645f16f70488ed33164568557ff4 Mon Sep 17 00:00:00 2001 From: Jeff Hill Date: Tue, 11 Feb 1992 16:45:02 +0000 Subject: [PATCH] verify channel before delete (catch corrupt client) --- src/rsrv/camessage.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/rsrv/camessage.c b/src/rsrv/camessage.c index b725e0f87..629b88304 100644 --- a/src/rsrv/camessage.c +++ b/src/rsrv/camessage.c @@ -38,6 +38,7 @@ * to avoid deadlock condition between the client * and the server. * .06 joh 110491 lock added for IOC_CLAIM_CIU command + * .07 joh 021192 verify channels to be deleted prior to deletion */ #include @@ -347,8 +348,26 @@ struct client *client; FAST struct event_ext *pevext; FAST int status; struct channel_in_use *pciu = (struct channel_in_use *) mp->m_pciu; + struct channel_in_use *ptmpciu; LIST *peventq = &pciu->eventq; + + /* + * + * Verify the channel + * + */ + ptmpciu = (struct channel_in_use *) & client->addrq.node.next; + while (ptmpciu = (struct channel_in_use *) pciu->node.next){ + if(ptmpciu == pciu){ + break; + } + } + if(!ptmpciu){ + logMsg("CAS: Attempt to delete nonexistent channel ignored\n"); + return; + } + for (pevext = (struct event_ext *) peventq->node.next; pevext; pevext = (struct event_ext *) pevext->node.next) {