]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
2635. [bug] isc_inet_ntop() incorrectly handled 0.0/16 addresses.
authorEvan Hunt <each@isc.org>
Sat, 18 Jul 2009 21:14:57 +0000 (21:14 +0000)
committerEvan Hunt <each@isc.org>
Sat, 18 Jul 2009 21:14:57 +0000 (21:14 +0000)
[RT #19716]

CHANGES
lib/isc/inet_ntop.c

diff --git a/CHANGES b/CHANGES
index 6885521e08745d3516e527ccf4fdec6b3edfda15..92706e8c6f37aba179508d5cc4550796f0672d34 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+2635.  [bug]           isc_inet_ntop() incorrectly handled 0.0/16 addresses.
+                       [RT #19716]
+
 2633.  [bug]           Handle 15 bit rand() functions. [RT #19783]
 
 2632.  [func]          util/kit.sh: warn if documentation appears to be out of
index dc053ededfba7d5abc655df77104355a0b255dac..996023ee0c4351570e1981334c7177599eb64c4b 100644 (file)
@@ -19,7 +19,7 @@
 
 #if defined(LIBC_SCCS) && !defined(lint)
 static char rcsid[] =
-       "$Id: inet_ntop.c,v 1.19 2007/06/19 23:47:17 tbox Exp $";
+       "$Id: inet_ntop.c,v 1.19.332.1 2009/07/18 21:14:57 each Exp $";
 #endif /* LIBC_SCCS and not lint */
 
 #include <config.h>
@@ -169,8 +169,9 @@ inet_ntop6(const unsigned char *src, char *dst, size_t size)
                if (i != 0)
                        *tp++ = ':';
                /* Is this address an encapsulated IPv4? */
-               if (i == 6 && best.base == 0 &&
-                   (best.len == 6 || (best.len == 5 && words[5] == 0xffff))) {
+               if (i == 6 && best.base == 0 && (best.len == 6 ||
+                   (best.len == 7 && words[7] != 0x0001) ||
+                   (best.len == 5 && words[5] == 0xffff))) {
                        if (!inet_ntop4(src+12, tp,
                                        sizeof(tmp) - (tp - tmp)))
                                return (NULL);