summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xlibvncserver/sockets.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libvncserver/sockets.c b/libvncserver/sockets.c
index 7840da0..48d024c 100755
--- a/libvncserver/sockets.c
+++ b/libvncserver/sockets.c
@@ -499,7 +499,7 @@ rfbReadExactTimeout(rfbClientPtr cl, char* buf, int len, int timeout)
int rfbReadExact(rfbClientPtr cl,char* buf,int len)
{
/* favor the per-screen value if set */
- if(cl->screen->maxClientWait)
+ if(cl->screen && cl->screen->maxClientWait)
return(rfbReadExactTimeout(cl,buf,len,cl->screen->maxClientWait));
else
return(rfbReadExactTimeout(cl,buf,len,rfbMaxClientWait));
@@ -521,7 +521,7 @@ rfbWriteExact(rfbClientPtr cl,
fd_set fds;
struct timeval tv;
int totalTimeWaited = 0;
- const int timeout = cl->screen->maxClientWait ? cl->screen->maxClientWait : rfbMaxClientWait;
+ const int timeout = (cl->screen && cl->screen->maxClientWait) ? cl->screen->maxClientWait : rfbMaxClientWait;
#undef DEBUG_WRITE_EXACT
#ifdef DEBUG_WRITE_EXACT