From: Mathieu Poirier <mathieu.poirier@linaro.org>
To: Saud Farooqui <farooqui_saud@hotmail.com>
Cc: bjorn.andersson@linaro.org, linux-remoteproc@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] rpmsg: strcpy is not safe, use strncpy
Date: Wed, 22 Jun 2022 11:46:16 -0600 [thread overview]
Message-ID: <20220622174616.GD1606016@p14s> (raw)
In-Reply-To: <PA4P189MB1421005C22E46EBD708EBA798BA49@PA4P189MB1421.EURP189.PROD.OUTLOOK.COM>
Hi Saud,
On Wed, Jun 08, 2022 at 11:43:30PM +0500, Saud Farooqui wrote:
> 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));
Please use strscpy_pad() instead of strncpy().
Thanks,
Mathieu
>
> dev_set_name(dev, "%s.%s.%d.%d", dev_name(dev->parent),
> rpdev->id.name, rpdev->src, rpdev->dst);
> --
> 2.25.1
>
next prev parent reply other threads:[~2022-06-22 17:46 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220622174616.GD1606016@p14s \
--to=mathieu.poirier@linaro.org \
--cc=bjorn.andersson@linaro.org \
--cc=farooqui_saud@hotmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-remoteproc@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.