unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Carlos O'Donell via Libc-alpha <libc-alpha@sourceware.org>
To: Florian Weimer <fweimer@redhat.com>, libc-alpha@sourceware.org
Subject: Re: [PATCH] nss_dns: Do not call res_dnok in getnetby* implementation
Date: Thu, 4 Jun 2020 09:08:46 -0400	[thread overview]
Message-ID: <0eca505e-a2d3-867e-60f9-56046e1eaaf1@redhat.com> (raw)
In-Reply-To: <20190308204424.0744F80DD6B5@oldenburg2.str.redhat.com>

On 3/8/19 3:44 PM, Florian Weimer wrote:
> The argument to res_dnok was produced by ns_name_ntop, so it
> is a syntactically valid domain name which, in textual format,
> only consists of printable characters.  Therefore, the res_dnok
> check always passes.
> 
> 2019-03-08  Florian Weimer  <fweimer@redhat.com>
> 
> 	* resolv/nss_dns/dns-network.c (getanswer_r): Do not call
> 	res_dnok.

LGTM.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>

> diff --git a/resolv/nss_dns/dns-network.c b/resolv/nss_dns/dns-network.c
> index 4b81b1bfdc..4617b165db 100644
> --- a/resolv/nss_dns/dns-network.c
> +++ b/resolv/nss_dns/dns-network.c
> @@ -348,7 +348,7 @@ getanswer_r (const querybuf *answer, int anslen, struct netent *result,
>        if (n > 0 && bp[0] == '.')
>  	bp[0] = '\0';
>  
> -      if (n < 0 || res_dnok (bp) == 0)
> +      if (n < 0)
>  	break;
>        cp += n;
>  
> @@ -382,7 +382,7 @@ getanswer_r (const querybuf *answer, int anslen, struct netent *result,
>  	      n = -1;
>  	    }
>  
> -	  if (n < 0 || !res_hnok (bp))
> +	  if (n < 0)
>  	    {
>  	      /* XXX What does this mean?  The original form from bind
>  		 returns NULL. Incrementing cp has no effect in any case.
> 


-- 
Cheers,
Carlos.


      parent reply	other threads:[~2020-06-04 13:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-08 20:44 [PATCH] nss_dns: Do not call res_dnok in getnetby* implementation Florian Weimer
2019-03-11 19:35 ` DJ Delorie
2020-06-04 13:08 ` Carlos O'Donell via Libc-alpha [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/libc/involved.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0eca505e-a2d3-867e-60f9-56046e1eaaf1@redhat.com \
    --to=libc-alpha@sourceware.org \
    --cc=carlos@redhat.com \
    --cc=fweimer@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).