Project

General

Profile

Bug #3489 ยป thread-NULL-deref.patch

patch - meyering (Jim Meyering), 06/27/2010 11:14 PM

View differences:

thread.c
if (o < sizeof(fd_set)) o = sizeof(fd_set);
if (m > o) {
fds->fdset = realloc(fds->fdset, m);
fds->fdset = xrealloc(fds->fdset, m);
memset((char *)fds->fdset + o, 0, m - o);
}
if (n >= fds->maxfd) fds->maxfd = n + 1;
......
if (size < sizeof(fd_set)) size = sizeof(fd_set);
dst->maxfd = max;
dst->fdset = realloc(dst->fdset, size);
dst->fdset = xrealloc(dst->fdset, size);
memcpy(dst->fdset, src, size);
}
    (1-1/1)