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)

Location:
branches/samba-3.3.x/source/lib
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/samba-3.3.x/source/lib/events.c

    r221 r578  
    141141        struct fd_event *fde;
    142142
     143        if (fd < 0 || fd >= FD_SETSIZE) {
     144                errno = EBADF;
     145                return NULL;
     146        }
     147
    143148        if (!(fde = TALLOC_P(mem_ctx, struct fd_event))) {
    144149                return NULL;
     
    191196
    192197        for (fde = event_ctx->fd_events; fde; fde = fde->next) {
     198                if (fde->fd < 0 || fde->fd >= FD_SETSIZE) {
     199                        /* We ignore here, as it shouldn't be
     200                           possible to add an invalid fde->fd
     201                           but we don't want FD_SET to see an
     202                           invalid fd. */
     203                        continue;
     204                }
     205
    193206                if (fde->flags & EVENT_FD_READ) {
    194207                        FD_SET(fde->fd, read_fds);
  • branches/samba-3.3.x/source/lib/packet.c

    r206 r578  
    107107        fd_set r_fds;
    108108
     109        if (ctx->fd < 0 || ctx->fd >= FD_SETSIZE) {
     110                errno = EBADF;
     111                return map_nt_error_from_unix(errno);
     112        }
     113
    109114        FD_ZERO(&r_fds);
    110115        FD_SET(ctx->fd, &r_fds);
  • branches/samba-3.3.x/source/lib/readline.c

    r206 r578  
    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);
  • branches/samba-3.3.x/source/lib/select.c

    r206 r578  
    6666                        smb_panic("Could not create select pipe");
    6767
     68                if (select_pipe[0] < 0 || select_pipe[0] >= FD_SETSIZE) {
     69                        errno = EBADF;
     70                        return -1;
     71                }
     72
    6873                /*
    6974                 * These next two lines seem to fix a bug with the Linux
     
    9297                FD_ZERO(readfds2);
    9398        }
     99
    94100        FD_SET(select_pipe[0], readfds2);
    95101
  • branches/samba-3.3.x/source/lib/util_sock.c

    r206 r578  
    961961
    962962        for (nread=0; nread < mincnt; ) {
     963                if (fd < 0 || fd >= FD_SETSIZE) {
     964                        errno = EBADF;
     965                        return map_nt_error_from_unix(EBADF);
     966                }
     967
    963968                FD_ZERO(&fds);
    964969                FD_SET(fd,&fds);
     
    14931498        for (i=0; i<num_addrs; i++) {
    14941499                sockets[i] = socket(addrs[i].ss_family, SOCK_STREAM, 0);
    1495                 if (sockets[i] < 0)
     1500                if (sockets[i] < 0 || sockets[i] >= FD_SETSIZE)
    14961501                        goto done;
    14971502                set_blocking(sockets[i], false);
     
    15421547
    15431548        for (i=0; i<num_addrs; i++) {
    1544                 if (sockets[i] == -1)
     1549                if (sockets[i] < 0 || sockets[i] >= FD_SETSIZE) {
     1550                        /* This cannot happen - ignore if so. */
    15451551                        continue;
     1552                }
    15461553                FD_SET(sockets[i], &wr_fds);
    15471554                FD_SET(sockets[i], &r_fds);
Note: See TracChangeset for help on using the changeset viewer.