2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 14:35:26 +00:00

2635. [bug] isc_inet_ntop() incorrectly handled 0.0/16 addresses.

[RT #19716]
This commit is contained in:
Evan Hunt
2009-07-17 22:01:44 +00:00
parent aeff7de836
commit 3967528c77
2 changed files with 7 additions and 3 deletions

View File

@@ -1,3 +1,6 @@
2635. [bug] isc_inet_ntop() incorrectly handled 0.0/16 addresses.
[RT #19716]
2634. [port] win32: Add support for libxml2, enable
statschannel. [RT #19773]

View 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.20 2009/07/17 22:01:44 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);