public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] rpmsg: strcpy is not safe, use strncpy
@ 2022-06-08 18:43 Saud Farooqui
  2022-06-09 21:08 ` kernel test robot
  2022-06-22 17:46 ` Mathieu Poirier
  0 siblings, 2 replies; 5+ messages in thread
From: Saud Farooqui @ 2022-06-08 18:43 UTC (permalink / raw)
  To: bjorn.andersson, mathieu.poirier, linux-remoteproc, linux-kernel
  Cc: Saud Farooqui

Replace strcpy with strncpy for copying the rpmsg
device name in rpmsg_register_device_override

Signed-off-by: Saud Farooqui <farooqui_saud@hotmail.com>
---
 drivers/rpmsg/rpmsg_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/rpmsg/rpmsg_core.c b/drivers/rpmsg/rpmsg_core.c
index 290c1f02da10..d3b29c19715d 100644
--- a/drivers/rpmsg/rpmsg_core.c
+++ b/drivers/rpmsg/rpmsg_core.c
@@ -604,7 +604,7 @@ int rpmsg_register_device_override(struct rpmsg_device *rpdev,
 	int ret;
 
 	if (driver_override)
-		strcpy(rpdev->id.name, driver_override);
+		strncpy(rpdev->id.name, driver_override, sizeof(rpdev->id.name));
 
 	dev_set_name(dev, "%s.%s.%d.%d", dev_name(dev->parent),
 		     rpdev->id.name, rpdev->src, rpdev->dst);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-06-24 17:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-08 18:43 [PATCH] rpmsg: strcpy is not safe, use strncpy Saud Farooqui
2022-06-09 21:08 ` kernel test robot
2022-06-22 17:46 ` Mathieu Poirier
2022-06-23  9:20   ` [PATCH v1] rpmsg: strcpy is not safe, use strscpy_pad() instead Saud Farooqui
2022-06-24 17:38     ` Mathieu Poirier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox