Skip to content

Commit 99de650

Browse files
fsaudmathieupoirier
authored andcommitted
rpmsg: Strcpy is not safe, use strscpy_pad() instead
Replace strcpy() with strscpy_pad() for copying the rpmsg device name in rpmsg_register_device_override(). Reported-by: kernel test robot <[email protected]> Signed-off-by: Saud Farooqui <[email protected]> Link: https://lore.kernel.org/r/PA4P189MB14210AA95DCA3715AFA7F4A68BB59@PA4P189MB1421.EURP189.PROD.OUTLOOK.COM Signed-off-by: Mathieu Poirier <[email protected]>
1 parent d7bd416 commit 99de650

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/rpmsg/rpmsg_core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,7 @@ int rpmsg_register_device_override(struct rpmsg_device *rpdev,
604604
int ret;
605605

606606
if (driver_override)
607-
strcpy(rpdev->id.name, driver_override);
607+
strscpy_pad(rpdev->id.name, driver_override, RPMSG_NAME_SIZE);
608608

609609
dev_set_name(dev, "%s.%s.%d.%d", dev_name(dev->parent),
610610
rpdev->id.name, rpdev->src, rpdev->dst);

0 commit comments

Comments
 (0)