Skip to content

Commit

Permalink
dns_resolver: Null-terminate the right string
Browse files Browse the repository at this point in the history
*_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>
Fixes: 84a7c0b ("dns_resolver: assure that dns_query() result is null-terminated")
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
bwhacks authored and davem330 committed Jul 21, 2014
1 parent 653bbf1 commit 640d7ef
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/dns_resolver/dns_query.c
Expand Up @@ -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;
Expand Down

0 comments on commit 640d7ef

Please sign in to comment.