From 6992d8c19554d3e960aceacd626c238ab5fadedc Mon Sep 17 00:00:00 2001 From: Quentin Rameau Date: Tue, 23 Apr 2024 09:32:47 -0700 Subject: [PATCH] Remove arbitrary limit from DNS result parsing 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. This check was non-breaking but spurious prior to TCP fallback support, since any 512-byte packet with more than 63 records was necessarily malformed. But now, it wrongly rejects valid results. Reported by Daniel Stefanik in Alpine Linux aports issue 15320. --- third_party/musl/dns_parse.c | 1 - 1 file changed, 1 deletion(-) diff --git a/third_party/musl/dns_parse.c b/third_party/musl/dns_parse.c index 5dc3e1f1d..924d85a2d 100644 --- a/third_party/musl/dns_parse.c +++ b/third_party/musl/dns_parse.c @@ -40,7 +40,6 @@ int __dns_parse(const unsigned char *r, int rlen, 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)