diff options
Diffstat (limited to 'deps/cares/src/ares_create_query.c')
-rw-r--r-- | deps/cares/src/ares_create_query.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/deps/cares/src/ares_create_query.c b/deps/cares/src/ares_create_query.c index 07d7570114..1606b1a100 100644 --- a/deps/cares/src/ares_create_query.c +++ b/deps/cares/src/ares_create_query.c @@ -94,6 +94,10 @@ int ares_create_query(const char *name, int dnsclass, int type, size_t buflen; unsigned char *buf; + /* Per RFC 7686, reject queries for ".onion" domain names with NXDOMAIN. */ + if (ares__is_onion_domain(name)) + return ARES_ENOTFOUND; + /* Set our results early, in case we bail out early with an error. */ *buflenp = 0; *bufp = NULL; @@ -188,7 +192,7 @@ int ares_create_query(const char *name, int dnsclass, int type, * specified in RFC 1035 ("To simplify implementations, the total length of * a domain name (i.e., label octets and label length octets) is restricted * to 255 octets or less."). */ - if (buflen > (MAXCDNAME + HFIXEDSZ + QFIXEDSZ + + if (buflen > (size_t)(MAXCDNAME + HFIXEDSZ + QFIXEDSZ + (max_udp_size ? EDNSFIXEDSZ : 0))) { ares_free (buf); return ARES_EBADNAME; |