diff options
author | guido <guido@FreeBSD.org> | 1997-03-10 19:32:46 +0000 |
---|---|---|
committer | guido <guido@FreeBSD.org> | 1997-03-10 19:32:46 +0000 |
commit | 39c96d6474f91fa081183ba05b1ae0b1a14beeff (patch) | |
tree | c299fcc2d4c101bbe655d7319aa38f34aef9b4a4 /lib | |
parent | 09f1f2a58b7ffce1ef2b6ca92ddde070e2210a6e (diff) | |
download | FreeBSD-src-39c96d6474f91fa081183ba05b1ae0b1a14beeff.zip FreeBSD-src-39c96d6474f91fa081183ba05b1ae0b1a14beeff.tar.gz |
Check for overflow of FD_SET
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libc/net/res_send.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/libc/net/res_send.c b/lib/libc/net/res_send.c index 26a0e51..12373d5 100644 --- a/lib/libc/net/res_send.c +++ b/lib/libc/net/res_send.c @@ -56,7 +56,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)res_send.c 8.1 (Berkeley) 6/4/93"; static char orig_rcsid[] = "From: Id: res_send.c,v 8.12 1996/10/08 04:51:06 vixie Exp"; -static char rcsid[] = "$Id$"; +static char rcsid[] = "$Id: res_send.c,v 1.13 1997/02/22 15:00:35 peter Exp $"; #endif /* LIBC_SCCS and not lint */ /* @@ -574,6 +574,11 @@ read_len: if ((long) timeout.tv_sec <= 0) timeout.tv_sec = 1; timeout.tv_usec = 0; + if (s+1 > FD_SETSIZE) { + Perror(stderr, "res_send: too many files"); + res_close(); + goto next_ns; + } wait: FD_ZERO(&dsmask); FD_SET(s, &dsmask); |