Skip to content

Commit 6992d8c

Browse files
Quentin Rameaujart
authored andcommitted
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.
1 parent 1a6b4ab commit 6992d8c

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

third_party/musl/dns_parse.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ int __dns_parse(const unsigned char *r, int rlen,
4040
p = r+12;
4141
qdcount = r[4]*256 + r[5];
4242
ancount = r[6]*256 + r[7];
43-
if (qdcount+ancount > 64) return -1;
4443
while (qdcount--) {
4544
while (p-r < rlen && *p-1U < 127) p++;
4645
if (p>r+rlen-6)

0 commit comments

Comments
 (0)