o detection of semicolon comments in resolv.conf
o avoid using system's inet_net_pton affected by the WLB-2008080064 advisory
+ o replacement ares_inet_net_pton affected by the WLB-2008080064 advisory
Version 1.7.4 (December 9, 2010)
o detection of semicolon comments in resolv.conf
o avoid using system's inet_net_pton affected by the WLB-2008080064 advisory
+ o replacement ares_inet_net_pton affected by the WLB-2008080064 advisory
Thanks go to these friendly people for their efforts and contributions:
ch = *src++;
if (ch == '0' && (src[0] == 'x' || src[0] == 'X')
+ && ISASCII(src[1])
&& ISXDIGIT(src[1])) {
/* Hexadecimal: Eat nybble string. */
if (!size)
goto emsgsize;
dirty = 0;
src++; /* skip x or X. */
- while ((ch = *src++) != '\0' && ISXDIGIT(ch)) {
+ while ((ch = *src++) != '\0' && ISASCII(ch) && ISXDIGIT(ch)) {
if (ISUPPER(ch))
ch = tolower(ch);
n = (int)(strchr(xdigits, ch) - xdigits);
goto emsgsize;
*dst++ = (unsigned char) (tmp << 4);
}
- } else if (ISDIGIT(ch)) {
+ } else if (ISASCII(ch) && ISDIGIT(ch)) {
/* Decimal: eat dotted digit string. */
for (;;) {
tmp = 0;
if (tmp > 255)
goto enoent;
} while ((ch = *src++) != '\0' &&
- ISDIGIT(ch));
+ ISASCII(ch) && ISDIGIT(ch));
if (!size--)
goto emsgsize;
*dst++ = (unsigned char) tmp;
if (ch != '.')
goto enoent;
ch = *src++;
- if (!ISDIGIT(ch))
+ if (!ISASCII(ch) || !ISDIGIT(ch))
goto enoent;
}
} else
goto enoent;
bits = -1;
- if (ch == '/' &&
+ if (ch == '/' && ISASCII(src[0]) &&
ISDIGIT(src[0]) && dst > odst) {
/* CIDR width specifier. Nothing can follow it. */
ch = *src++; /* Skip over the /. */
n = (int)(strchr(digits, ch) - digits);
bits *= 10;
bits += n;
- } while ((ch = *src++) != '\0' && ISDIGIT(ch));
+ if (bits > 32)
+ goto enoent;
+ } while ((ch = *src++) != '\0' && ISASCII(ch) && ISDIGIT(ch));
if (ch != '\0')
goto enoent;
- if (bits > 32)
- goto emsgsize;
}
/* Firey death and destruction unless we prefetched EOS. */
return 0;
return (result > -1 ? 1 : -1);
}
-#endif /* HAVE_INET_PTON */
+#endif