r14760: Fix #3642, ensure we don't call FD_SET on read with fd == -1.
authorJeremy Allison <jra@samba.org>
Wed, 29 Mar 2006 18:55:39 +0000 (18:55 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 16:15:46 +0000 (11:15 -0500)
Jeremy.

source/nsswitch/wb_common.c

index 0e2092794116eb2f62e8f96e3666cf11ca65a8e1..dfefeb9f7547f1a904807dbcdf4f98147f0728bb 100644 (file)
@@ -411,6 +411,10 @@ static int read_sock(void *buffer, int count)
        int result = 0, nread = 0;
        int total_time = 0, selret;
 
+       if (winbindd_fd == -1) {
+               return -1;
+       }
+
        /* Read data from socket */
        while(nread < count) {
                struct timeval tv;