]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
pullup:
authorAndreas Gustafsson <source@isc.org>
Wed, 23 Jan 2002 02:34:14 +0000 (02:34 +0000)
committerAndreas Gustafsson <source@isc.org>
Wed, 23 Jan 2002 02:34:14 +0000 (02:34 +0000)
pullup from BIND 8:
1185.   [bug]           libbind: don't assume statp->_u._ext.ext is valid
                        unless RES_INIT is set when calling res_*init().

1184.   [bug]           libbind: call res_ndestroy() if RES_INIT is set
                        when res_*init() is called.

CHANGES
lib/bind/resolv/res_init.c

diff --git a/CHANGES b/CHANGES
index 7944523dd7d50f7ae325ba007551d0fb18f0f4b0..4785e8a1bb04a4fc8d21035a8d311b5a685858ad 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,12 @@
 1186.   [bug]           isc_hex_tobuffer(,,length = 0) failed to unget the
                         EOL token when reading to end of line.
 
+1185.  [bug]           libbind: don't assume statp->_u._ext.ext is valid
+                       unless RES_INIT is set when calling res_*init().
+
+1184.  [bug]           libbind: call res_ndestroy() if RES_INIT is set
+                       when res_*init() is called.
+
 1182.  [bug]           The server could throw an assertion failure when
                        constructing a negative response packet.
 
index 6072617ef122f63125f31cec56ca521e4efc9273..ae552181b45e022a808162aae1f91cab87dae5a8 100644 (file)
@@ -70,7 +70,7 @@
 
 #if defined(LIBC_SCCS) && !defined(lint)
 static const char sccsid[] = "@(#)res_init.c   8.1 (Berkeley) 6/7/93";
-static const char rcsid[] = "$Id: res_init.c,v 1.9 2001/07/03 06:55:04 marka Exp $";
+static const char rcsid[] = "$Id: res_init.c,v 1.9.2.1 2002/01/23 02:31:15 gson Exp $";
 #endif /* LIBC_SCCS and not lint */
 
 #include "port_before.h"
@@ -169,6 +169,9 @@ __res_vinit(res_state statp, int preinit) {
                statp->id = res_randomid();
        }
 
+       if ((statp->options & RES_INIT) != 0)
+               res_ndestroy(statp);
+
 #ifdef USELOOPBACK
        statp->nsaddr.sin_addr = inet_makeaddr(IN_LOOPBACKNET, 1);
 #else
@@ -187,14 +190,12 @@ __res_vinit(res_state statp, int preinit) {
        statp->qhook = NULL;
        statp->rhook = NULL;
        statp->_u._ext.nscount = 0;
-       if (statp->_u._ext.ext == NULL) {
-           statp->_u._ext.ext = malloc(sizeof(*statp->_u._ext.ext));
-           if (statp->_u._ext.ext != NULL) {
+       statp->_u._ext.ext = malloc(sizeof(*statp->_u._ext.ext));
+       if (statp->_u._ext.ext != NULL) {
                memset(statp->_u._ext.ext, 0, sizeof(*statp->_u._ext.ext));
                statp->_u._ext.ext->nsaddrs[0].sin = statp->nsaddr;
                strcpy(statp->_u._ext.ext->nsuffix, "ip6.int");
                strcpy(statp->_u._ext.ext->bsuffix, "ip6.arpa");
-           }
        }
 #ifdef RESOLVSORT
        statp->nsort = 0;