-
Notifications
You must be signed in to change notification settings - Fork 693
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
main/musl: fix error return code for getaddrinfo
needed for fixing dns tests in nodejs test suite nodejs/node#5099
- Loading branch information
Showing
2 changed files
with
38 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
From 9ba48c2e4f1a8a0670ffc40c02ac6a909c62668e Mon Sep 17 00:00:00 2001 | ||
From: Natanael Copa <ncopa@alpinelinux.org> | ||
Date: Wed, 25 May 2016 09:37:54 +0200 | ||
Subject: [PATCH] check result from res_mkquery | ||
|
||
we don't want to try send a query that may be malformatted. | ||
--- | ||
src/network/lookup_name.c | 4 ++++ | ||
1 file changed, 4 insertions(+) | ||
|
||
diff --git a/src/network/lookup_name.c b/src/network/lookup_name.c | ||
index 86f90ac..d3d97b4 100644 | ||
--- a/src/network/lookup_name.c | ||
+++ b/src/network/lookup_name.c | ||
@@ -145,11 +145,15 @@ static int name_from_dns(struct address buf[static MAXADDRS], char canon[static | ||
if (family != AF_INET6) { | ||
qlens[nq] = __res_mkquery(0, name, 1, RR_A, 0, 0, 0, | ||
qbuf[nq], sizeof *qbuf); | ||
+ if (qlens[nq] == -1) | ||
+ return EAI_NONAME; | ||
nq++; | ||
} | ||
if (family != AF_INET) { | ||
qlens[nq] = __res_mkquery(0, name, 1, RR_AAAA, 0, 0, 0, | ||
qbuf[nq], sizeof *qbuf); | ||
+ if (qlens[nq] == -1) | ||
+ return EAI_NONAME; | ||
nq++; | ||
} | ||
|
||
-- | ||
2.8.4 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters