diff options
author | Jun-ichiro itojun Hagino <itojun@cvs.openbsd.org> | 1999-12-08 09:31:16 +0000 |
---|---|---|
committer | Jun-ichiro itojun Hagino <itojun@cvs.openbsd.org> | 1999-12-08 09:31:16 +0000 |
commit | 8714d23212bcebe28ed8d4b387da23605bb44ee2 (patch) | |
tree | cd09bd53048bee055ad89d8ad24fa2a9f38d00a0 /lib/libc/net | |
parent | 3f3fff9f5d68aa1319f0503da06f65782885c777 (diff) |
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')
-rw-r--r-- | lib/libc/net/inet_pton.c | 6 |
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); |