diff options
author | itojun <> | 1999-12-08 09:31:15 +0000 |
---|---|---|
committer | itojun <> | 1999-12-08 09:31:15 +0000 |
commit | 4f28b045b71f2e358d99dada79f93e6b020cd078 (patch) | |
tree | 42a1542bf5b71934eee976121287b1c91c5f757c /src | |
parent | 1eee4d1967ee7c7c3b3fa499a7666c5ba46dc0c4 (diff) | |
download | openbsd-4f28b045b71f2e358d99dada79f93e6b020cd078.tar.gz openbsd-4f28b045b71f2e358d99dada79f93e6b020cd078.tar.bz2 openbsd-4f28b045b71f2e358d99dada79f93e6b020cd078.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 'src')
-rw-r--r-- | src/lib/libc/net/inet_pton.c | 6 |
1 files changed, 4 insertions, 2 deletions
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 @@ | |||
1 | /* $OpenBSD: inet_pton.c,v 1.2 1997/04/13 05:08:24 deraadt Exp $ */ | 1 | /* $OpenBSD: inet_pton.c,v 1.3 1999/12/08 09:31:15 itojun Exp $ */ |
2 | 2 | ||
3 | /* Copyright (c) 1996 by Internet Software Consortium. | 3 | /* Copyright (c) 1996 by Internet Software Consortium. |
4 | * | 4 | * |
@@ -20,7 +20,7 @@ | |||
20 | #if 0 | 20 | #if 0 |
21 | static char rcsid[] = "$From: inet_pton.c,v 8.7 1996/08/05 08:31:35 vixie Exp $"; | 21 | static char rcsid[] = "$From: inet_pton.c,v 8.7 1996/08/05 08:31:35 vixie Exp $"; |
22 | #else | 22 | #else |
23 | static char rcsid[] = "$OpenBSD: inet_pton.c,v 1.2 1997/04/13 05:08:24 deraadt Exp $"; | 23 | static char rcsid[] = "$OpenBSD: inet_pton.c,v 1.3 1999/12/08 09:31:15 itojun Exp $"; |
24 | #endif | 24 | #endif |
25 | #endif /* LIBC_SCCS and not lint */ | 25 | #endif /* LIBC_SCCS and not lint */ |
26 | 26 | ||
@@ -176,6 +176,8 @@ inet_pton6(src, dst) | |||
176 | return (0); | 176 | return (0); |
177 | colonp = tp; | 177 | colonp = tp; |
178 | continue; | 178 | continue; |
179 | } else if (*src == '\0') { | ||
180 | return (0); | ||
179 | } | 181 | } |
180 | if (tp + INT16SZ > endp) | 182 | if (tp + INT16SZ > endp) |
181 | return (0); | 183 | return (0); |