summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1998-03-31 00:16:31 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1998-03-31 00:16:31 +0000
commit5ef0dd40a8ef306d2fa808937c14c2adfab66e38 (patch)
treec36bc489d4cb7a9064e204de51d082b512b66c69 /usr.sbin
parente8336313626641516a0d893a13ff0a8c927be515 (diff)
fix fake-iquery
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/named/named/ns_req.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/usr.sbin/named/named/ns_req.c b/usr.sbin/named/named/ns_req.c
index 56add68532d..1d5c8c0d257 100644
--- a/usr.sbin/named/named/ns_req.c
+++ b/usr.sbin/named/named/ns_req.c
@@ -1,11 +1,11 @@
-/* $OpenBSD: ns_req.c,v 1.3 1997/05/07 22:43:29 millert Exp $ */
+/* $OpenBSD: ns_req.c,v 1.4 1998/03/31 00:16:30 deraadt Exp $ */
#if !defined(lint) && !defined(SABER)
#if 0
static char sccsid[] = "@(#)ns_req.c 4.47 (Berkeley) 7/1/91";
static char rcsid[] = "$From: ns_req.c,v 8.27 1996/10/08 04:51:03 vixie Exp $";
#else
-static char rcsid[] = "$OpenBSD: ns_req.c,v 1.3 1997/05/07 22:43:29 millert Exp $";
+static char rcsid[] = "$OpenBSD: ns_req.c,v 1.4 1998/03/31 00:16:30 deraadt Exp $";
#endif
#endif /* not lint */
@@ -1015,7 +1015,7 @@ req_iquery(hp, cpp, eom, buflenp, msg, from)
switch (type) {
case T_A:
#ifndef INVQ
- if (!fake_iquery)
+ if (!fake_iquery || dlen != INT32SZ)
return (Refuse);
#endif
#ifdef INVQ
@@ -1029,7 +1029,10 @@ req_iquery(hp, cpp, eom, buflenp, msg, from)
dprintf(1, (ddt, "req: IQuery class %d type %d\n", class, type));
fname = (char *)msg + HFIXEDSZ;
- bcopy(fname, anbuf, alen = (char *)*cpp - fname);
+ alen = (char *)*cpp - fname;
+ if ((size_t)alen > sizeof anbuf)
+ return (Refuse);
+ bcopy(fname, anbuf, alen);
data = anbuf + alen - dlen;
*cpp = (u_char *)fname;
*buflenp -= HFIXEDSZ;