char *d, *c = strchr(a, '.');
if (!c != !i)
return 0;
- l = strtoul(a, &d, 10);
+ l = bstrtoul10(a, &d);
if (((d != c) && *d) || (l > 255))
return 0;
ia = (ia << 8) | l;
int i, j, k, l, hfil;
const char *start;
+ if (!a[0]) /* Empty string check */
+ return 0;
+
if (a[0] == ':') /* Leading :: */
{
if (a[1] != ':')
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++)