diff options
author | dscho <dscho> | 2005-05-16 16:18:59 +0000 |
---|---|---|
committer | dscho <dscho> | 2005-05-16 16:18:59 +0000 |
commit | c42529c3f877cb0bd830e0b6ccb5a6758dfacc46 (patch) | |
tree | 651b83fa16c3bec6a458a10ed381010a61f2afc3 /libvncserver | |
parent | 8bee4eb990273c3654431467ba6618eb916f030a (diff) | |
download | libtdevnc-c42529c3f877cb0bd830e0b6ccb5a6758dfacc46.tar.gz libtdevnc-c42529c3f877cb0bd830e0b6ccb5a6758dfacc46.zip |
fix SIGSEGV when client has incompatible protocol; release mutex before freeing it
Diffstat (limited to 'libvncserver')
-rw-r--r-- | libvncserver/rfbserver.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libvncserver/rfbserver.c b/libvncserver/rfbserver.c index fceb02c..22bdc98 100644 --- a/libvncserver/rfbserver.c +++ b/libvncserver/rfbserver.c @@ -235,6 +235,9 @@ rfbNewTCPOrUDPClient(rfbScreenInfoPtr rfbScreen, rfbResetStats(cl); + cl->clientData = NULL; + cl->clientGoneHook = rfbDoNothingWithClient; + if(isUDP) { rfbLog(" accepted UDP client\n"); } else { @@ -353,8 +356,6 @@ rfbNewTCPOrUDPClient(rfbScreenInfoPtr rfbScreen, } } - cl->clientData = NULL; - cl->clientGoneHook = rfbDoNothingWithClient; switch (cl->screen->newClientHook(cl)) { case RFB_CLIENT_ON_HOLD: cl->onHold = TRUE; @@ -458,7 +459,9 @@ rfbClientConnectionGone(rfbClientPtr cl) TINI_COND(cl->updateCond); TINI_MUTEX(cl->updateMutex); + /* make sure outputMutex is unlocked before destroying */ LOCK(cl->outputMutex); + UNLOCK(cl->outputMutex); TINI_MUTEX(cl->outputMutex); #ifdef CORBA |