~stefanor/ubuntu/maverick/samba/ntlm-auth-623342

« back to all changes in this revision

Viewing changes to source3/lib/select.c

  • Committer: Bazaar Package Importer
  • Author(s): Marc Deslauriers
  • Date: 2011-02-23 13:12:33 UTC
  • mfrom: (125.1.2 maverick-proposed)
  • Revision ID: james.westby@ubuntu.com-20110223131233-kvhu879m0pyd5l71
* SECURITY UPDATE: denial of service via missing range checks on file
  descriptors
  - debian/patches/security-CVE-2011-0719.patch: validate miscellaneous
    file descriptors.
  - CVE-2011-0719

Show diffs side-by-side

added added

removed removed

Lines of Context:
75
75
                        return -1;
76
76
                }
77
77
 
 
78
                if (select_pipe[0] < 0 || select_pipe[0] >= FD_SETSIZE) {
 
79
                        DEBUG(0, ("sys_select: bad fd\n"));
 
80
                        if (readfds != NULL)
 
81
                                FD_ZERO(readfds);
 
82
                        if (writefds != NULL)
 
83
                                FD_ZERO(writefds);
 
84
                        if (errorfds != NULL)
 
85
                                FD_ZERO(errorfds);
 
86
                        errno = EBADF;
 
87
                        return -1;
 
88
                }
78
89
                /*
79
90
                 * These next two lines seem to fix a bug with the Linux
80
91
                 * 2.0.x kernel (and probably other UNIXes as well) where
101
112
                readfds2 = &readfds_buf;
102
113
                FD_ZERO(readfds2);
103
114
        }
 
115
 
104
116
        FD_SET(select_pipe[0], readfds2);
105
117
 
106
118
        errno = 0;