* [PATCH COMMITTED] nss_dns: Remove superfluous dn_expand call from network handling
@ 2017-04-04 19:01 Florian Weimer
2017-04-04 20:15 ` Andreas Schwab
0 siblings, 1 reply; 3+ messages in thread
From: Florian Weimer @ 2017-04-04 19:01 UTC (permalink / raw)
To: libc-alpha
2017-04-04 Florian Weimer <fweimer@redhat.com>
* resolv/nss_dns/dns-network.c (getanswer_r): Remove __dn_expand
call whose result is not used.
diff --git a/resolv/nss_dns/dns-network.c b/resolv/nss_dns/dns-network.c
index 45f7f18..fd8c565 100644
--- a/resolv/nss_dns/dns-network.c
+++ b/resolv/nss_dns/dns-network.c
@@ -324,11 +324,8 @@ getanswer_r (const querybuf *answer, int anslen, struct netent *result,
while (--answer_count >= 0 && cp < end_of_message)
{
- int n = dn_expand (answer->buf, end_of_message, cp, bp, linebuflen);
- int type, class;
-
- n = __ns_name_unpack (answer->buf, end_of_message, cp,
- packtmp, sizeof packtmp);
+ int n = __ns_name_unpack (answer->buf, end_of_message, cp,
+ packtmp, sizeof packtmp);
if (n != -1 && __ns_name_ntop (packtmp, bp, linebuflen) == -1)
{
if (errno == EMSGSIZE)
@@ -350,6 +347,7 @@ getanswer_r (const querybuf *answer, int anslen, struct netent *result,
return NSS_STATUS_UNAVAIL;
}
+ int type, class;
GETSHORT (type, cp);
GETSHORT (class, cp);
cp += INT32SZ; /* TTL */
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH COMMITTED] nss_dns: Remove superfluous dn_expand call from network handling
2017-04-04 19:01 [PATCH COMMITTED] nss_dns: Remove superfluous dn_expand call from network handling Florian Weimer
@ 2017-04-04 20:15 ` Andreas Schwab
2017-04-05 6:51 ` Florian Weimer
0 siblings, 1 reply; 3+ messages in thread
From: Andreas Schwab @ 2017-04-04 20:15 UTC (permalink / raw)
To: Florian Weimer; +Cc: libc-alpha
On Apr 04 2017, fweimer@redhat.com (Florian Weimer) wrote:
> * resolv/nss_dns/dns-network.c (getanswer_r): Remove __dn_expand
> call whose result is not used.
What about the side effect?
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH COMMITTED] nss_dns: Remove superfluous dn_expand call from network handling
2017-04-04 20:15 ` Andreas Schwab
@ 2017-04-05 6:51 ` Florian Weimer
0 siblings, 0 replies; 3+ messages in thread
From: Florian Weimer @ 2017-04-05 6:51 UTC (permalink / raw)
To: Andreas Schwab; +Cc: libc-alpha
On 04/04/2017 10:15 PM, Andreas Schwab wrote:
> On Apr 04 2017, fweimer@redhat.com (Florian Weimer) wrote:
>
>> * resolv/nss_dns/dns-network.c (getanswer_r): Remove __dn_expand
>> call whose result is not used.
>
> What about the side effect?
The result buffer is overwritten by the subsequent ns_name_ntop call.
Thanks,
Florian
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-04-05 6:51 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-04 19:01 [PATCH COMMITTED] nss_dns: Remove superfluous dn_expand call from network handling Florian Weimer
2017-04-04 20:15 ` Andreas Schwab
2017-04-05 6:51 ` Florian Weimer
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).