resolv_process_responses() clears the whole response buffer before
each receive. The receive operation supplies the message length and
all parser accesses are bounded by the corresponding end pointer, so
no byte beyond the received message is observed.
Remove the unnecessary buffer clear.
/* process all pending input messages */
while (1) {
/* read message received */
- memset(buf, '\0', resolvers->accepted_payload_size + 1);
if ((buflen = dns_recv_nameserver(ns, (void *)buf, sizeof(buf))) <= 0) {
break;
}