]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
1339. [func] libbind: log attempts to exploit #1338.
authorMark Andrews <marka@isc.org>
Fri, 28 Jun 2002 06:12:42 +0000 (06:12 +0000)
committerMark Andrews <marka@isc.org>
Fri, 28 Jun 2002 06:12:42 +0000 (06:12 +0000)
CHANGES
lib/bind/irs/dns_ho.c

diff --git a/CHANGES b/CHANGES
index 916628976f9f843f4eaf7508f2a20a65b53d380d..e2c1fb0fdbae5db13a6405cc328b1f59dbb29149 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,5 @@
+1339.  [func]          libbind: log attempts to exploit #1338.
+
 1338.  [bug]           libbind: Remote buffer overrun.
 
 1337.  [port]          libbind: TrueUNIX 5.1 does not like __align as a
index 9f51df9cc88c7ef10006fea17c19774b2a8cdcbb..bb7b512bcdc2e6298afca2185db8ed8f9e2cc72b 100644 (file)
@@ -52,7 +52,7 @@
 /* BIND Id: gethnamaddr.c,v 8.15 1996/05/22 04:56:30 vixie Exp $ */
 
 #if defined(LIBC_SCCS) && !defined(lint)
-static const char rcsid[] = "$Id: dns_ho.c,v 1.10 2002/06/28 06:06:23 marka Exp $";
+static const char rcsid[] = "$Id: dns_ho.c,v 1.11 2002/06/28 06:12:42 marka Exp $";
 #endif /* LIBC_SCCS and not lint */
 
 /* Imports. */
@@ -74,6 +74,7 @@ static const char rcsid[] = "$Id: dns_ho.c,v 1.10 2002/06/28 06:06:23 marka Exp
 #include <resolv.h>
 #include <stdio.h>
 #include <string.h>
+#include <syslog.h>
 
 #include <isc/memcluster.h>
 #include <irs.h>
@@ -1194,6 +1195,15 @@ gethostans(struct irs_ho *this,
                eor = cp + n;
                if ((qtype == T_A || qtype == T_AAAA || qtype == ns_t_a6 ||
                     qtype == T_ANY) && type == T_CNAME) {
+                       if (haveanswer) {
+                               int level = LOG_CRIT;
+#ifdef LOG_SECURITY
+                               level |= LOG_SECURITY;
+#endif
+                               syslog(level,
+ "gethostans: possible attempt to exploit buffer overflow while looking up %s",
+                                       *qname ? qname : ".");
+                       }
                        n = dn_expand(ansbuf, eor, cp, tbuf, sizeof tbuf);
                        if (n < 0 || !maybe_ok(pvt->res, tbuf, name_ok)) {
                                had_error++;