Ticket #34730: patch-libvncserver-sockets.c.diff

File patch-libvncserver-sockets.c.diff, 677 bytes (added by pixilla (Bradley Giesbrecht), 12 years ago)

files/patch-libvncserver-sockets.c.diff

  • libvncserver/sockets.c

    a b  
    402402      rfbLogPerror("rfbProcessNewConnection: error in select");
    403403      return FALSE;
    404404    }
    405     if (FD_ISSET(rfbScreen->listenSock, &listen_fds))
     405    if (rfbScreen->listenSock >= 0 && FD_ISSET(rfbScreen->listenSock, &listen_fds))
    406406      chosen_listen_sock = rfbScreen->listenSock;
    407     if (FD_ISSET(rfbScreen->listen6Sock, &listen_fds))
     407    if (rfbScreen->listen6Sock >= 0 && FD_ISSET(rfbScreen->listen6Sock, &listen_fds))
    408408      chosen_listen_sock = rfbScreen->listen6Sock;
    409409
    410410    if ((sock = accept(chosen_listen_sock,