Avoid calling SSL_pending when connection is already closed

Avoid calling SSL_pending when connection is already closed, calling SSL_pending with connection already closed is crashing. 
To reproduce, open a secure websocket binay protocol connection with libvncserver compiled with OpenSSL, and when libvncserver is waiting for rfbProcessClientProtocolVersion send any invalid char, it will fail and call rfbCloseClient whith destroy all SSL context, calling SSL_pending after that will generate a invalid access.
pull/1/head
George Fleury 9 years ago
parent 785f0fa2d1
commit 1417cb1c3f

@ -394,7 +394,7 @@ rfbCheckFds(rfbScreenInfoPtr rfbScreen,long usec)
#ifdef LIBVNCSERVER_WITH_WEBSOCKETS #ifdef LIBVNCSERVER_WITH_WEBSOCKETS
do { do {
rfbProcessClientMessage(cl); rfbProcessClientMessage(cl);
} while (webSocketsHasDataInBuffer(cl)); } while (cl->sock > 0 && webSocketsHasDataInBuffer(cl));
#else #else
rfbProcessClientMessage(cl); rfbProcessClientMessage(cl);
#endif #endif

Loading…
Cancel
Save