mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-09-18 22:19:30 +02:00
keys, dns: Drop unused NUL terminator from upayload->data
upayload->data includes an extra NUL terminator even though it is never used as a C string. In-tree users access only the first upayload->datalen bytes. Remove the redundant NUL terminator and allocate one byte less for upayload->data in dns_resolver_preparse(). Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://patch.msgid.link/20260806200454.245444-3-thorsten.blum@linux.dev Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
committed by
Jakub Kicinski
parent
fd23a7c973
commit
f1529936c0
@@ -203,7 +203,7 @@ store_result:
|
||||
kdebug("store result");
|
||||
prep->quotalen = result_len;
|
||||
|
||||
upayload = kmalloc_flex(*upayload, data, result_len + 1);
|
||||
upayload = kmalloc_flex(*upayload, data, result_len);
|
||||
if (!upayload) {
|
||||
kleave(" = -ENOMEM");
|
||||
return -ENOMEM;
|
||||
@@ -211,7 +211,6 @@ store_result:
|
||||
|
||||
upayload->datalen = result_len;
|
||||
memcpy(upayload->data, data, result_len);
|
||||
upayload->data[result_len] = '\0';
|
||||
|
||||
prep->payload.data[dns_key_data] = upayload;
|
||||
kleave(" = 0");
|
||||
|
||||
Reference in New Issue
Block a user