-
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: handle DNS responses with 64+ IP address records
This was discussed on the #musl IRC channel. A legacy check returns an error when more than 63 IP addresses are returned in a DNS response. This patch removes that check & error. Fixes #15320
- Loading branch information
1 parent
9000bc6
commit a22cf87
Showing
2 changed files
with
30 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
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,27 @@ | ||
Date: Wed, 4 Oct 2023 21:29:43 +0200 | ||
From: Quentin Rameau <quinq@fifth.space> | ||
To: musl@lists.openwall.com | ||
Subject: [PATCH] Remove arbitrary limit from NS resolution | ||
|
||
The name resolution would abort when getting more than 63 records per | ||
request, due to what seems to be a left-over from the original code. | ||
|
||
Somehow reported by Daniel Stefanik[0]. | ||
|
||
[0] https://gitlab.alpinelinux.org/alpine/aports/-/issues/15320 | ||
--- | ||
src/network/dns_parse.c | 1 - | ||
1 file changed, 1 deletion(-) | ||
|
||
diff --git a/src/network/dns_parse.c b/src/network/dns_parse.c | ||
index ea1ec126..09813112 100644 | ||
--- a/src/network/dns_parse.c | ||
+++ b/src/network/dns_parse.c | ||
@@ -12,7 +12,6 @@ int __dns_parse(const unsigned char *r, int rlen, int (*callback)(void *, int, c | ||
p = r+12; | ||
qdcount = r[4]*256 + r[5]; | ||
ancount = r[6]*256 + r[7]; | ||
- if (qdcount+ancount > 64) return -1; | ||
while (qdcount--) { | ||
while (p-r < rlen && *p-1U < 127) p++; | ||
if (p>r+rlen-6) |