This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] nss_dns: Adjust ns_name_ntop failure handling in getnetby*
- 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:50:09 -0400
- Subject: Re: [PATCH] nss_dns: Adjust ns_name_ntop failure handling in getnetby*
Florian Weimer <fweimer@redhat.com> writes:
> - if (n > 0 && bp[0] == '.')
> - bp[0] = '\0';
> -
> + if (bp[0] == '.')
> + bp[0] = '\0';
This now references bp[0] when n == 0, which it didn't before. But,
ns_name_ntop always nul terminates the buffer, so bp[0] is always
well-defined. OK. What about the case where __ns_name_unpack() returns
zero? It looks like that might have been a bug in the old version?
Otherwise LGTM.