summaryrefslogtreecommitdiff
path: root/lib/ip.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ip.c')
-rw-r--r--lib/ip.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/ip.c b/lib/ip.c
index 2d195160..fcc72caf 100644
--- a/lib/ip.c
+++ b/lib/ip.c
@@ -264,6 +264,9 @@ ip6_pton(const char *a, ip6_addr *o)
int i, j, k, l, hfil;
const char *start;
+ if (!a[0]) /* Empty string check */
+ return 0;
+
if (a[0] == ':') /* Leading :: */
{
if (a[1] != ':')
@@ -333,6 +336,8 @@ ip6_pton(const char *a, ip6_addr *o)
for (; i>=hfil; i--)
words[i] = 0;
}
+ else if (i != 8) /* Incomplete address */
+ return 0;
/* Convert the address to ip6_addr format */
for (i=0; i<4; i++)