mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 17:47:41 +02:00
net: eth: benet: Use strscpy() to copy strings into arrays
Replacing strcpy() with strscpy() ensures that overflow of the target buffer cannot happen. Signed-off-by: David Laight <david.laight.linux@gmail.com> Link: https://patch.msgid.link/20260608095500.2567-4-david.laight.linux@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
8e0ffcc926
commit
9f9fdd88e9
|
|
@ -2508,7 +2508,7 @@ int lancer_cmd_read_object(struct be_adapter *adapter, struct be_dma_mem *cmd,
|
|||
|
||||
req->desired_read_len = cpu_to_le32(data_size);
|
||||
req->read_offset = cpu_to_le32(data_offset);
|
||||
strcpy(req->object_name, obj_name);
|
||||
strscpy(req->object_name, obj_name);
|
||||
req->descriptor_count = cpu_to_le32(1);
|
||||
req->buf_len = cpu_to_le32(data_size);
|
||||
req->addr_low = cpu_to_le32((cmd->dma & 0xFFFFFFFF));
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user