Ignore:
Timestamp:
Jun 25, 2011, 7:14:41 PM (14 years ago)
Author:
Herwig Bauernfeind
Message:

Update Samba 3.3 to 3.3.15 (security update)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/samba-3.3.x/source/nmbd/nmbd_packets.c

    r206 r578  
    16841684                count++;
    16851685
    1686         if((count*2) + 2 > FD_SETSIZE) {
     1686        if((count*2) + 2 >= FD_SETSIZE) {
    16871687                DEBUG(0,("create_listen_fdset: Too many file descriptors needed (%d). We can \
    16881688only use %d.\n", (count*2) + 2, FD_SETSIZE));
     
    17001700
    17011701        /* Add in the broadcast socket on 137. */
     1702        if (ClientNMB < 0 || ClientNMB >= FD_SETSIZE) {
     1703                errno = EBADF;
     1704                SAFE_FREE(pset);
     1705                return True;
     1706        }
     1707
    17021708        FD_SET(ClientNMB,pset);
    17031709        sock_array[num++] = ClientNMB;
     
    17061712        /* Add in the 137 sockets on all the interfaces. */
    17071713        for (subrec = FIRST_SUBNET; subrec; subrec = NEXT_SUBNET_EXCLUDING_UNICAST(subrec)) {
     1714                if (subrec->nmb_sock < 0 || subrec->nmb_sock >= FD_SETSIZE) {
     1715                        /* We have to ignore sockets outside FD_SETSIZE. */
     1716                        continue;
     1717                }
    17081718                FD_SET(subrec->nmb_sock,pset);
    17091719                sock_array[num++] = subrec->nmb_sock;
     
    17121722
    17131723        /* Add in the broadcast socket on 138. */
     1724        if (ClientDGRAM < 0 || ClientDGRAM >= FD_SETSIZE) {
     1725                errno = EBADF;
     1726                SAFE_FREE(pset);
     1727                return True;
     1728        }
     1729
    17141730        FD_SET(ClientDGRAM,pset);
    17151731        sock_array[num++] = ClientDGRAM;
     
    17181734        /* Add in the 138 sockets on all the interfaces. */
    17191735        for (subrec = FIRST_SUBNET; subrec; subrec = NEXT_SUBNET_EXCLUDING_UNICAST(subrec)) {
     1736                if (subrec->dgram_sock < 0 || subrec->dgram_sock >= FD_SETSIZE) {
     1737                        /* We have to ignore sockets outside FD_SETSIZE. */
     1738                        continue;
     1739                }
    17201740                FD_SET(subrec->dgram_sock,pset);
    17211741                sock_array[num++] = subrec->dgram_sock;
     
    17681788#ifndef SYNC_DNS
    17691789        dns_fd = asyncdns_fd();
    1770         if (dns_fd != -1) {
     1790        if (dns_fd >= 0 && dns_fd < FD_SETSIZE) {
    17711791                FD_SET(dns_fd, &r_fds);
    17721792                maxfd = MAX( maxfd, dns_fd);
Note: See TracChangeset for help on using the changeset viewer.