mirror of
git://git.musl-libc.org/musl
synced 2025-03-06 20:48:29 +01:00
dns response handling: don't treat too many addresses as an error
returning -1 rather than 0 from the parse function causes __dns_parse to bail out and return an error. presently, name_from_dns does not check the return value anyway, so this does not matter, but if it ever started treating this as an error, lookups with large numbers of addresses would break. this is a consequence of adding TCP support and extending the buffer size used in name_from_dns.
This commit is contained in:
parent
41603c7706
commit
0a7b4323b0
1 changed files with 1 additions and 1 deletions
|
@ -115,7 +115,7 @@ static int dns_parse_callback(void *c, int rr, const void *data, int len, const
|
|||
{
|
||||
char tmp[256];
|
||||
struct dpc_ctx *ctx = c;
|
||||
if (ctx->cnt >= MAXADDRS) return -1;
|
||||
if (ctx->cnt >= MAXADDRS) return 0;
|
||||
switch (rr) {
|
||||
case RR_A:
|
||||
if (rr != ctx->rrtype) return 0;
|
||||
|
|
Loading…
Add table
Reference in a new issue