Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit aceac05

Browse filesBrowse files
XadillaXMylesBorins
authored andcommitted
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. Backport-PR-URL: #27542 PR-URL: #25840 Fixes: #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>
1 parent 2a98b9c commit aceac05
Copy full SHA for aceac05

2 files changed

+14-4Lines changed: 14 additions & 4 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎deps/cares/src/ares_create_query.c‎

Copy file name to clipboardExpand all lines: deps/cares/src/ares_create_query.c
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,14 +94,14 @@ int ares_create_query(const char *name, int dnsclass, int type,
9494
size_t buflen;
9595
unsigned char *buf;
9696

97-
/* Per RFC 7686, reject queries for ".onion" domain names with NXDOMAIN. */
98-
if (ares__is_onion_domain(name))
99-
return ARES_ENOTFOUND;
100-
10197
/* Set our results early, in case we bail out early with an error. */
10298
*buflenp = 0;
10399
*bufp = NULL;
104100

101+
/* Per RFC 7686, reject queries for ".onion" domain names with NXDOMAIN. */
102+
if (ares__is_onion_domain(name))
103+
return ARES_ENOTFOUND;
104+
105105
/* Allocate a memory area for the maximum size this packet might need. +2
106106
* is for the length byte and zero termination if no dots or ecscaping is
107107
* used.
Collapse file

‎test/parallel/test-dns.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-dns.js
+10Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,3 +314,13 @@ common.expectsError(() => {
314314
code: 'ERR_INVALID_CALLBACK',
315315
type: TypeError
316316
});
317+
318+
{
319+
dns.resolveMx('foo.onion', function(err) {
320+
assert.deepStrictEqual(err.errno, 'ENOTFOUND');
321+
assert.deepStrictEqual(err.code, 'ENOTFOUND');
322+
assert.deepStrictEqual(err.syscall, 'queryMx');
323+
assert.deepStrictEqual(err.hostname, 'foo.onion');
324+
assert.deepStrictEqual(err.message, 'queryMx ENOTFOUND foo.onion');
325+
});
326+
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.