This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] nss_dns: Enforce QDCOUNT == 1 in getnetby* implementation
- From: DJ Delorie <dj at redhat dot com>
- To: Florian Weimer <fweimer at redhat dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Mon, 11 Mar 2019 17:22:46 -0400
- Subject: Re: [PATCH] nss_dns: Enforce QDCOUNT == 1 in getnetby* implementation
Florian Weimer <fweimer@redhat.com> writes:
> The stub resolver sends a query with one question record, so if
> the answer contains a different number, the DNS message is
> corrupted.
The resolver now returns a different error code when question_count is
zero. Is this intentional? Does this need to be documented anywhere?
> + if (n < 0 || end_of_message - (cp + n) < QFIXEDSZ)
> + goto bad_message;
And this part sets errno, which it didn't before.