X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=rts%2Fposix%2FSelect.c;fp=rts%2Fposix%2FSelect.c;h=932fc792fed511384d1a92cc3c51ba33b0585985;hb=d0fb9a95f40453321b82e23d9b322e79340b48c9;hp=d36e122079e366adf30df0e141170e4f0a424327;hpb=860195b72e08f44539f0569e06d2efaad2bb05a1;p=ghc-hetmet.git diff --git a/rts/posix/Select.c b/rts/posix/Select.c index d36e122..932fc79 100644 --- a/rts/posix/Select.c +++ b/rts/posix/Select.c @@ -156,7 +156,7 @@ awaitEvent(rtsBool wait) case BlockedOnRead: { int fd = tso->block_info.fd; - if (fd >= (int)FD_SETSIZE) { + if ((fd >= (int)FD_SETSIZE) || (fd < 0)) { barf("awaitEvent: descriptor out of range"); } maxfd = (fd > maxfd) ? fd : maxfd; @@ -167,7 +167,7 @@ awaitEvent(rtsBool wait) case BlockedOnWrite: { int fd = tso->block_info.fd; - if (fd >= (int)FD_SETSIZE) { + if ((fd >= (int)FD_SETSIZE) || (fd < 0)) { barf("awaitEvent: descriptor out of range"); } maxfd = (fd > maxfd) ? fd : maxfd;