A pointer to fd_set was used uninitialized when nfds == 0.
* desc.c (decode_select): Initialize fds.
Reported-by: Zubin Mithra <zubin.mithra@gmail.com>
{
int i, j;
int nfds, fdsize;
- fd_set *fds;
+ fd_set *fds = NULL;
const char *sep;
long arg;
nfds = (int) args[0];
/* Kernel rejects negative nfds, so we don't parse it either. */
- if (nfds < 0) {
+ if (nfds < 0)
nfds = 0;
- fds = NULL;
- }
+
/* Beware of select(2^31-1, NULL, NULL, NULL) and similar... */
if (nfds > 1024*1024)
nfds = 1024*1024;