Skip to content

Commit 640d7ef

Browse files
bwhacksdavem330
authored andcommitted
dns_resolver: Null-terminate the right string
*_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>
1 parent 653bbf1 commit 640d7ef

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/dns_resolver/dns_query.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ int dns_query(const char *type, const char *name, size_t namelen,
150150
goto put;
151151

152152
memcpy(*_result, upayload->data, len);
153-
*_result[len] = '\0';
153+
(*_result)[len] = '\0';
154154

155155
if (_expiry)
156156
*_expiry = rkey->expiry;

0 commit comments

Comments
 (0)