Ignore:
Timestamp:
Jul 1, 2011, 9:17:44 AM (14 years ago)
Author:
Herwig Bauernfeind
Message:

Samba 3.5: Update vendor to version 3.5.7

Location:
vendor/current/source3/lib
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • vendor/current/source3/lib/events.c

    r427 r591  
    5656
    5757        for (fde = ev->fd_events; fde; fde = fde->next) {
     58                if (fde->fd < 0 || fde->fd >= FD_SETSIZE) {
     59                        /* We ignore here, as it shouldn't be
     60                           possible to add an invalid fde->fd
     61                           but we don't want FD_SET to see an
     62                           invalid fd. */
     63                        continue;
     64                }
     65
    5866                if (fde->flags & EVENT_FD_READ) {
    5967                        FD_SET(fde->fd, read_fds);
  • vendor/current/source3/lib/g_lock.c

    r453 r591  
    392392                        FD_ZERO(r_fds);
    393393                        max_fd = ctdbd_conn_get_fd(conn);
    394                         FD_SET(max_fd, r_fds);
     394                        if (max_fd >= 0 && max_fd < FD_SETSIZE) {
     395                                FD_SET(max_fd, r_fds);
     396                        }
    395397                }
    396398#endif
  • vendor/current/source3/lib/packet.c

    r414 r591  
    108108        fd_set r_fds;
    109109
     110        if (ctx->fd < 0 || ctx->fd >= FD_SETSIZE) {
     111                errno = EBADF;
     112                return map_nt_error_from_unix(errno);
     113        }
     114
    110115        FD_ZERO(&r_fds);
    111116        FD_SET(ctx->fd, &r_fds);
  • vendor/current/source3/lib/readline.c

    r414 r591  
    9292                timeout.tv_usec = 0;
    9393
     94                if (fd < 0 || fd >= FD_SETSIZE) {
     95                        errno = EBADF;
     96                        break;
     97                }
     98
    9499                FD_ZERO(&fds);
    95100                FD_SET(fd,&fds);
  • vendor/current/source3/lib/select.c

    r414 r591  
    7676                }
    7777
     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                }
    7889                /*
    7990                 * These next two lines seem to fix a bug with the Linux
     
    102113                FD_ZERO(readfds2);
    103114        }
     115
    104116        FD_SET(select_pipe[0], readfds2);
    105117
  • vendor/current/source3/lib/util_sock.c

    r414 r591  
    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.