diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1998-09-03 02:01:40 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1998-09-03 02:01:40 +0000 |
commit | 412c6f39b0ebc7296b18e9b2297e2202de67b2af (patch) | |
tree | 9ea293c458d6b794e4821b661b687b9550254f55 | |
parent | 72bd4b9ad45a0b3b7f04536889092b39943427b8 (diff) |
buf overlook
-rw-r--r-- | usr.sbin/named/nslookup/getinfo.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/usr.sbin/named/nslookup/getinfo.c b/usr.sbin/named/nslookup/getinfo.c index 8d0b6cf4589..4c688587f6b 100644 --- a/usr.sbin/named/nslookup/getinfo.c +++ b/usr.sbin/named/nslookup/getinfo.c @@ -1,4 +1,4 @@ -/* $OpenBSD: getinfo.c,v 1.3 1997/04/06 19:00:22 millert Exp $ */ +/* $OpenBSD: getinfo.c,v 1.4 1998/09/03 02:01:39 deraadt Exp $ */ /* * ++Copyright++ 1985, 1989 @@ -60,7 +60,7 @@ static char sccsid[] = "@(#)getinfo.c 5.26 (Berkeley) 3/21/91"; static char rcsid[] = "$From: getinfo.c,v 8.6 1996/12/02 09:17:24 vixie Exp $"; #else -static char rcsid[] = "$OpenBSD: getinfo.c,v 1.3 1997/04/06 19:00:22 millert Exp $"; +static char rcsid[] = "$OpenBSD: getinfo.c,v 1.4 1998/09/03 02:01:39 deraadt Exp $"; #endif #endif /* not lint */ @@ -183,6 +183,11 @@ GetAnswer(nsAddrPtr, queryType, msg, msglen, iquery, hostPtr, isServer) printf("SendRequest failed\n"); return (status); } + if (n > sizeof(answer)) { + if (_res.options & RES_DEBUG2) + printf("SendRequest overflowed\n"); + return (-1); + } eom = (u_char *) &answer + n; headerPtr = (HEADER *) &answer; |