Skip to content

Commit

Permalink
dns_resolver: Null-terminate the right string
Browse files Browse the repository at this point in the history
[ Upstream commit 640d7ef ]

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

Signed-off-by: Ben Hutchings <[email protected]>
Fixes: 84a7c0b ("dns_resolver: assure that dns_query() result is null-terminated")
Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
bwhacks authored and gregkh committed Jul 28, 2014
1 parent b477b4d commit 78ed26d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/dns_resolver/dns_query.c
Original file line number Diff line number Diff line change
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 78ed26d

Please sign in to comment.