mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
dns_resolver: assure that dns_query() result is null-terminated
[ Upstream commit 84a7c0b1db
]
dns_query() credulously assumes that keys are null-terminated and
returns a copy of a memory block that is off by one.
Signed-off-by: Manuel Schölling <manuel.schoelling@gmx.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
7670d47228
commit
c304a23b4e
1 changed files with 3 additions and 1 deletions
|
@ -150,7 +150,9 @@ int dns_query(const char *type, const char *name, size_t namelen,
|
|||
if (!*_result)
|
||||
goto put;
|
||||
|
||||
memcpy(*_result, upayload->data, len + 1);
|
||||
memcpy(*_result, upayload->data, len);
|
||||
*_result[len] = '\0';
|
||||
|
||||
if (_expiry)
|
||||
*_expiry = rkey->expiry;
|
||||
|
||||
|
|
Loading…
Reference in a new issue