summaryrefslogtreecommitdiffstats
path: root/lib/libc/net/inet_pton.c
diff options
context:
space:
mode:
authoritojun <itojun@openbsd.org>1999-12-08 09:31:15 +0000
committeritojun <itojun@openbsd.org>1999-12-08 09:31:15 +0000
commitfdfdcbbfa408efa664bd9e5ebbd093fa8fdab301 (patch)
tree6cf9ccb6587a1624006f0a63960ca22752a3ef1b /lib/libc/net/inet_pton.c
parentipv6 support from KAME (needs no libc upgrade). regen keywords.[ch]. (diff)
downloadwireguard-openbsd-fdfdcbbfa408efa664bd9e5ebbd093fa8fdab301.tar.xz
wireguard-openbsd-fdfdcbbfa408efa664bd9e5ebbd093fa8fdab301.zip
fix BIND820 bug in inet_pton(). it should bark if there's ambiguous
text after IPv6 address string, like "0:1:2:3:4:5:6:7:8".
Diffstat (limited to 'lib/libc/net/inet_pton.c')
-rw-r--r--lib/libc/net/inet_pton.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/libc/net/inet_pton.c b/lib/libc/net/inet_pton.c
index 46b4b24819c..0cb13baa31e 100644
--- a/lib/libc/net/inet_pton.c
+++ b/lib/libc/net/inet_pton.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: inet_pton.c,v 1.2 1997/04/13 05:08:24 deraadt Exp $ */
+/* $OpenBSD: inet_pton.c,v 1.3 1999/12/08 09:31:15 itojun Exp $ */
/* Copyright (c) 1996 by Internet Software Consortium.
*
@@ -20,7 +20,7 @@
#if 0
static char rcsid[] = "$From: inet_pton.c,v 8.7 1996/08/05 08:31:35 vixie Exp $";
#else
-static char rcsid[] = "$OpenBSD: inet_pton.c,v 1.2 1997/04/13 05:08:24 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: inet_pton.c,v 1.3 1999/12/08 09:31:15 itojun Exp $";
#endif
#endif /* LIBC_SCCS and not lint */
@@ -176,6 +176,8 @@ inet_pton6(src, dst)
return (0);
colonp = tp;
continue;
+ } else if (*src == '\0') {
+ return (0);
}
if (tp + INT16SZ > endp)
return (0);