summaryrefslogtreecommitdiff
path: root/deps
diff options
context:
space:
mode:
authorXadillaX <i@2333.moe>2019-01-31 13:02:59 +0800
committerDaniel Bevenius <daniel.bevenius@gmail.com>2019-02-06 06:15:18 +0100
commit4cc9b5f28579d2b5f0ae9ef071fa2e6a4dcfd2ae (patch)
treee335644aadce188c804db560db48083d98f866a3 /deps
parent686043e76e676b68be63b1b33b8a09e64c9092e3 (diff)
downloadandroid-node-v8-4cc9b5f28579d2b5f0ae9ef071fa2e6a4dcfd2ae.tar.gz
android-node-v8-4cc9b5f28579d2b5f0ae9ef071fa2e6a4dcfd2ae.tar.bz2
android-node-v8-4cc9b5f28579d2b5f0ae9ef071fa2e6a4dcfd2ae.zip
deps: patch to fix *.onion MX query on c-ares
c-ares rejects *.onion MX query but forgot to set `*bufp` to NULL. This will occur SegmentFault when free `*bufp`. I make this quick fix and then will make a PR for c-ares either. PR-URL: https://github.com/nodejs/node/pull/25840 Fixes: https://github.com/nodejs/node/issues/25839 Refs: https://github.com/c-ares/c-ares/blob/955df98/ares_create_query.c#L97-L103 Refs: https://github.com/c-ares/c-ares/blob/955df98/ares_query.c#L124 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'deps')
-rw-r--r--deps/cares/src/ares_create_query.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/deps/cares/src/ares_create_query.c b/deps/cares/src/ares_create_query.c
index 1606b1a100..9efce17cfa 100644
--- a/deps/cares/src/ares_create_query.c
+++ b/deps/cares/src/ares_create_query.c
@@ -94,14 +94,14 @@ 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;
+ /* Per RFC 7686, reject queries for ".onion" domain names with NXDOMAIN. */
+ if (ares__is_onion_domain(name))
+ return ARES_ENOTFOUND;
+
/* Allocate a memory area for the maximum size this packet might need. +2
* is for the length byte and zero termination if no dots or ecscaping is
* used.