mirror of
https://github.com/torvalds/linux.git
synced 2026-07-28 10:09:10 +02:00
RDMA/mlx5: Use strscpy() to copy strings into arrays
Replacing strcpy() with strscpy() ensures that overflow of the target buffer cannot happen. Link: https://patch.msgid.link/r/20260608095500.2567-2-david.laight.linux@gmail.com Signed-off-by: David Laight <david.laight.linux@gmail.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
This commit is contained in:
parent
16bf00323d
commit
6eb287509d
|
|
@ -88,7 +88,7 @@ int mlx5_data_direct_ib_reg(struct mlx5_ib_dev *ibdev, char *vuid)
|
|||
return -ENOMEM;
|
||||
|
||||
reg->ibdev = ibdev;
|
||||
strcpy(reg->vuid, vuid);
|
||||
strscpy(reg->vuid, vuid);
|
||||
|
||||
mutex_lock(&mlx5_data_direct_mutex);
|
||||
list_for_each_entry(dev, &mlx5_data_direct_dev_list, list) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user