Ignore:
Timestamp:
Jul 1, 2011, 10:18:23 AM (14 years ago)
Author:
Herwig Bauernfeind
Message:

Samba 3.5: Update trunk to 3.5.7

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/server/source3/lib/util_sock.c

    r454 r593  
    496496
    497497        for (nread=0; nread < mincnt; ) {
     498                if (fd < 0 || fd >= FD_SETSIZE) {
     499                        errno = EBADF;
     500                        return map_nt_error_from_unix(EBADF);
     501                }
     502
    498503                FD_ZERO(&fds);
    499504                FD_SET(fd,&fds);
     
    12361241        for (i=0; i<num_addrs; i++) {
    12371242                sockets[i] = socket(addrs[i].ss_family, SOCK_STREAM, 0);
    1238                 if (sockets[i] < 0)
     1243                if (sockets[i] < 0 || sockets[i] >= FD_SETSIZE)
    12391244                        goto done;
    12401245                set_blocking(sockets[i], false);
     
    12851290
    12861291        for (i=0; i<num_addrs; i++) {
    1287                 if (sockets[i] == -1)
     1292                if (sockets[i] < 0 || sockets[i] >= FD_SETSIZE) {
     1293                        /* This cannot happen - ignore if so. */
    12881294                        continue;
     1295                }
    12891296                FD_SET(sockets[i], &wr_fds);
    12901297                FD_SET(sockets[i], &r_fds);
     
    13061313        for (i=0; i<num_addrs; i++) {
    13071314
    1308                 if (sockets[i] == -1)
     1315                if (sockets[i] < 0 || sockets[i] >= FD_SETSIZE) {
     1316                        /* This cannot happen - ignore if so. */
    13091317                        continue;
     1318                }
    13101319
    13111320                /* Stevens, Network Programming says that if there's a
Note: See TracChangeset for help on using the changeset viewer.