Don't clear tcpfd for literal address server records.

They have smaller structs which don't include that field,
so this is a buffer overlow.

Error introduced in f5cdb007d8
This commit is contained in:
Simon Kelley
2024-11-21 15:18:19 +00:00
parent b5ac983bf6
commit 0adaf13438

View File

@@ -739,13 +739,14 @@ int add_update_server(int flags,
serv->addr = *addr;
if (source_addr)
serv->source_addr = *source_addr;
serv->tcpfd = -1;
}
serv->flags = flags;
serv->domain = alloc_domain;
serv->domain_len = strlen(alloc_domain);
serv->tcpfd = -1;
return 1;
}