From 4f28b045b71f2e358d99dada79f93e6b020cd078 Mon Sep 17 00:00:00 2001 From: itojun <> Date: Wed, 8 Dec 1999 09:31:15 +0000 Subject: 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". --- src/lib/libc/net/inet_pton.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/lib') diff --git a/src/lib/libc/net/inet_pton.c b/src/lib/libc/net/inet_pton.c index 46b4b24819..0cb13baa31 100644 --- a/src/lib/libc/net/inet_pton.c +++ b/src/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); -- cgit v1.2.3-55-g6feb