Commit c42529c3 authored by dscho's avatar dscho

fix SIGSEGV when client has incompatible protocol; release mutex before freeing it

parent 8bee4eb9
...@@ -235,6 +235,9 @@ rfbNewTCPOrUDPClient(rfbScreenInfoPtr rfbScreen, ...@@ -235,6 +235,9 @@ rfbNewTCPOrUDPClient(rfbScreenInfoPtr rfbScreen,
rfbResetStats(cl); rfbResetStats(cl);
cl->clientData = NULL;
cl->clientGoneHook = rfbDoNothingWithClient;
if(isUDP) { if(isUDP) {
rfbLog(" accepted UDP client\n"); rfbLog(" accepted UDP client\n");
} else { } else {
...@@ -353,8 +356,6 @@ rfbNewTCPOrUDPClient(rfbScreenInfoPtr rfbScreen, ...@@ -353,8 +356,6 @@ rfbNewTCPOrUDPClient(rfbScreenInfoPtr rfbScreen,
} }
} }
cl->clientData = NULL;
cl->clientGoneHook = rfbDoNothingWithClient;
switch (cl->screen->newClientHook(cl)) { switch (cl->screen->newClientHook(cl)) {
case RFB_CLIENT_ON_HOLD: case RFB_CLIENT_ON_HOLD:
cl->onHold = TRUE; cl->onHold = TRUE;
...@@ -458,7 +459,9 @@ rfbClientConnectionGone(rfbClientPtr cl) ...@@ -458,7 +459,9 @@ rfbClientConnectionGone(rfbClientPtr cl)
TINI_COND(cl->updateCond); TINI_COND(cl->updateCond);
TINI_MUTEX(cl->updateMutex); TINI_MUTEX(cl->updateMutex);
/* make sure outputMutex is unlocked before destroying */
LOCK(cl->outputMutex); LOCK(cl->outputMutex);
UNLOCK(cl->outputMutex);
TINI_MUTEX(cl->outputMutex); TINI_MUTEX(cl->outputMutex);
#ifdef CORBA #ifdef CORBA
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment