From: Heinz Mauelshagen Date: Tue, 7 Feb 2023 22:04:01 +0000 (+0100) Subject: dm ioctl: prefer strscpy() instead of strlcpy() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=22a8b84945e9a5027174e06ec5c8ce3d978844d6;p=linux.git dm ioctl: prefer strscpy() instead of strlcpy() Signed-off-by: Heinz Mauelshagen Signed-off-by: Mike Snitzer --- diff --git a/drivers/md/dm-ioctl.c b/drivers/md/dm-ioctl.c index 9a19bcd8fcfe7..f34d36a4b4a1c 100644 --- a/drivers/md/dm-ioctl.c +++ b/drivers/md/dm-ioctl.c @@ -937,9 +937,9 @@ static struct hash_cell *__find_device_hash_cell(struct dm_ioctl *param) * Sneakily write in both the name and the uuid * while we have the cell. */ - strlcpy(param->name, hc->name, sizeof(param->name)); + strscpy(param->name, hc->name, sizeof(param->name)); if (hc->uuid) - strlcpy(param->uuid, hc->uuid, sizeof(param->uuid)); + strscpy(param->uuid, hc->uuid, sizeof(param->uuid)); else param->uuid[0] = '\0';