Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-6]: src/dist/bind/bin/named Pull up revisions 1.5-1.6 (requeste...



details:   https://anonhg.NetBSD.org/src/rev/c3893d99efa9
branches:  netbsd-1-6
changeset: 528140:c3893d99efa9
user:      lukem <lukem%NetBSD.org@localhost>
date:      Fri Jun 28 11:32:37 2002 +0000

description:
Pull up revisions 1.5-1.6 (requested by itojun in ticket #387):
Update to BIND 8.3.3.  Fixes buffer overrun in resolver code.

diffstat:

 dist/bind/bin/named/ns_glue.c |  36 ++++++++++++++++++++----------------
 1 files changed, 20 insertions(+), 16 deletions(-)

diffs (127 lines):

diff -r 5c6b49239d8d -r c3893d99efa9 dist/bind/bin/named/ns_glue.c
--- a/dist/bind/bin/named/ns_glue.c     Fri Jun 28 11:32:27 2002 +0000
+++ b/dist/bind/bin/named/ns_glue.c     Fri Jun 28 11:32:37 2002 +0000
@@ -1,7 +1,7 @@
-/*     $NetBSD: ns_glue.c,v 1.4 2001/05/17 22:59:39 itojun Exp $       */
+/*     $NetBSD: ns_glue.c,v 1.4.2.1 2002/06/28 11:32:37 lukem Exp $    */
 
 #if !defined(lint) && !defined(SABER)
-static const char rcsid[] = "Id: ns_glue.c,v 8.20 2001/02/16 04:46:14 marka Exp";
+static const char rcsid[] = "Id: ns_glue.c,v 8.24 2002/01/07 02:54:37 marka Exp";
 #endif /* not lint */
 
 /*
@@ -181,8 +181,8 @@
 }
 
 void
-ns_assertion_failed(char *file, int line, assertion_type type, char *cond,
-                   int print_errno)
+ns_assertion_failed(const char *file, int line, assertion_type type,
+                   const char *cond, int print_errno)
 {
        ns_panic(ns_log_insist, 1, "%s:%d: %s(%s)%s%s failed.",
                file, line, assertion_type_to_text(type), cond,
@@ -190,7 +190,6 @@
                (print_errno) ? strerror(errno) : "");
 }
 
-#if 0
 /*
  * XXX This is for compatibility and should eventually be removed.
  */
@@ -198,7 +197,6 @@
 panic(const char *msg, const void *arg) {
        ns_panic(ns_log_default, 1, msg, arg);
 }
-#endif
 
 /*
  * How many labels in this name?
@@ -281,7 +279,11 @@
                s = close(fd);
        } while (s < 0 && errno == EINTR);
 
-       if (s < 0 && errno != EBADF)
+       /*
+        * Tru64 UNIX V5.1 can return a spurious EINVAL after connect()
+        * failures.
+        */
+       if (s < 0 && errno != EBADF && errno != EINVAL)
                ns_info(ns_log_default, "close(%d) failed: %s", fd,
                       strerror(errno));
        else
@@ -332,9 +334,10 @@
        return (__savestr_record(str, needpanic, __FILE__, __LINE__));
 }
 
-void
+void *
 __freestr(char *str) {
        __freestr_record(str, __FILE__, __LINE__);
+       return (NULL);
 }
 
 #ifdef DEBUG_STRINGS
@@ -368,7 +371,7 @@
        len += 3;       /* 2 length bytes + NUL. */
        printf("%s:%d: freestr %d %s\n", file, line, len, str);
        __freestr_record(str, file, line);
-       return;
+       return (NULL);
 }
 #endif /* DEBUG_STRINGS */
 
@@ -376,7 +379,7 @@
  * Return a counted string buffer big enough for a string of length 'len'.
  */
 char *
-__newstr_record(size_t len, int needpanic, char *file, int line) {
+__newstr_record(size_t len, int needpanic, const char *file, int line) {
        u_char *buf, *bp;
 
        REQUIRE(len <= 65536);
@@ -397,7 +400,7 @@
  * Save a NUL terminated string and return a pointer to it.
  */
 char *
-__savestr_record(const char *str, int needpanic, char *file, int line) {
+__savestr_record(const char *str, int needpanic, const char *file, int line) {
        char *buf;
        size_t len;
 
@@ -414,8 +417,8 @@
        return (buf);
 }
 
-void
-__freestr_record(char *str, char *file, int line) {
+void *
+__freestr_record(char *str, const char *file, int line) {
        u_char *buf, *bp;
        size_t len;
 
@@ -423,11 +426,12 @@
        bp = buf;
        NS_GET16(len, bp);
        __memput_record(buf, 2/*Len*/ + len + 1/*Nul*/, file, line);
+       return (NULL);
 }
 
-char *
+const char *
 checked_ctime(const time_t *t) {
-       char *ctime_result;
+       const char *ctime_result;
 
        ctime_result = ctime(t);
        if (ctime_result == NULL) {
@@ -442,7 +446,7 @@
  * Since the fields in a "struct timeval" are longs, and the argument to ctime
  * is a pointer to a time_t (which might not be a long), here's a bridge.
  */
-char *
+const char *
 ctimel(long l) {
        time_t t = (time_t)l;
 



Home | Main Index | Thread Index | Old Index