[PATCH] nss_dns: Adjust ns_name_ntop failure handling in getnetby*

DJ Delorie dj@redhat.com
Mon Mar 11 21:50:00 GMT 2019


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.



More information about the Libc-alpha mailing list