You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2022/07/27 12:36:58 UTC

[incubator-nuttx] 01/06: drivers:rptun use strlcpy inside of strcpy

This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit f9bcf1d645ec9481f171e65bded5a93282a3e2f5
Author: anjiahao <an...@xiaomi.com>
AuthorDate: Sat May 7 15:35:05 2022 +0800

    drivers:rptun use strlcpy inside of strcpy
    
    Signed-off-by: anjiahao <an...@xiaomi.com>
---
 drivers/rptun/rptun.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/rptun/rptun.c b/drivers/rptun/rptun.c
index 34efe39895..e71f9ef510 100644
--- a/drivers/rptun/rptun.c
+++ b/drivers/rptun/rptun.c
@@ -399,7 +399,7 @@ rptun_get_mem(FAR struct remoteproc *rproc,
   FAR struct rptun_priv_s *priv = rproc->priv;
 
   metal_list_init(&buf->node);
-  strcpy(buf->name, name ? name : "");
+  strlcpy(buf->name, name ? name : "", RPROC_MAX_NAME_LEN);
   buf->io = metal_io_get_region();
   buf->size = size;