netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] dns_resolver: Null-terminate the right string
@ 2014-07-11 20:31 Ben Hutchings
  2014-07-14  5:53 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Ben Hutchings @ 2014-07-11 20:31 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Manuel Schölling

[-- Attachment #1: Type: text/plain, Size: 750 bytes --]

*_result[len] is parsed as *(_result[len]) which is not at all what we
want to touch here.

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 net/dns_resolver/dns_query.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/dns_resolver/dns_query.c b/net/dns_resolver/dns_query.c
index 9acec61f..dd8696a 100644
--- a/net/dns_resolver/dns_query.c
+++ b/net/dns_resolver/dns_query.c
@@ -150,7 +150,7 @@ int dns_query(const char *type, const char *name, size_t namelen,
 		goto put;
 
 	memcpy(*_result, upayload->data, len);
-	*_result[len] = '\0';
+	(*_result)[len] = '\0';
 
 	if (_expiry)
 		*_expiry = rkey->expiry;

-- 
Ben Hutchings
To err is human; to really foul things up requires a computer.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 811 bytes --]

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net] dns_resolver: Null-terminate the right string
  2014-07-11 20:31 [PATCH net] dns_resolver: Null-terminate the right string Ben Hutchings
@ 2014-07-14  5:53 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2014-07-14  5:53 UTC (permalink / raw)
  To: ben; +Cc: netdev, manuel.schoelling

From: Ben Hutchings <ben@decadent.org.uk>
Date: Fri, 11 Jul 2014 21:31:25 +0100

> *_result[len] is parsed as *(_result[len]) which is not at all what we
> want to touch here.
> 
> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

Please add an appropriate Fixes: tag (for 84a7c0b1) or commit
reference in the commit message proper.

Thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-07-14  5:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-11 20:31 [PATCH net] dns_resolver: Null-terminate the right string Ben Hutchings
2014-07-14  5:53 ` David Miller

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 NNTP newsgroup(s).