xiaoxiang781216 commented on a change in pull request #5108:
URL: https://github.com/apache/incubator-nuttx/pull/5108#discussion_r776585684



##########
File path: fs/nfs/nfs_vfsops.c
##########
@@ -2006,7 +2006,7 @@ static int nfs_bind(FAR struct inode *blkdriver, FAR 
const void *data,
   nmp->nm_rsize       = nprmt.rsize;
   nmp->nm_readdirsize = nprmt.readdirsize;
 
-  strncpy(nmp->nm_path, argp->path, 90);
+  strlcpy(nmp->nm_path, argp->path, 90);

Review comment:
       90->sizeof(nmp->nm_path)

##########
File path: fs/smartfs/smartfs_utils.c
##########
@@ -671,8 +670,8 @@ int smartfs_finddirentry(struct smartfs_mountpt_s *fs,
 
                           memset(direntry->name, 0,
                                  fs->fs_llformat.namesize + 1);

Review comment:
       remove

##########
File path: fs/hostfs/hostfs.c
##########
@@ -1344,9 +1344,9 @@ int hostfs_rename(FAR struct inode *mountpt, FAR const 
char *oldrelpath,
 
   /* Append to the host's root directory */
 
-  strncpy(oldpath, fs->fs_root, sizeof(oldpath));
+  strlcpy(oldpath, fs->fs_root, sizeof(oldpath));
   strncat(oldpath, oldrelpath, sizeof(oldpath)-strlen(oldpath)-1);
-  strncpy(newpath, fs->fs_root, sizeof(newpath));
+  strlcpy(newpath, fs->fs_root, sizeof(newpath));
   strncat(newpath, newrelpath, sizeof(newpath)-strlen(newpath)-1);

Review comment:
       strlcat(newpath, newrelpath, sizeof(newpath));

##########
File path: fs/userfs/fs_userfs.c
##########
@@ -1938,8 +1938,8 @@ static int userfs_rename(FAR struct inode *mountpt,
   req->req       = USERFS_REQ_RENAME;
   req->newoffset = oldpathlen;
 
-  strncpy(req->oldrelpath, oldrelpath, oldpathlen);
-  strncpy(&req->oldrelpath[oldpathlen], newrelpath, newpathlen);
+  strlcpy(req->oldrelpath, oldrelpath, oldpathlen);
+  strlcpy(&req->oldrelpath[oldpathlen], newrelpath, newpathlen);

Review comment:
       revert, don't need change

##########
File path: fs/userfs/fs_userfs.c
##########
@@ -228,7 +228,7 @@ static int userfs_open(FAR struct file *filep, FAR const 
char *relpath,
   req->oflags = oflags;
   req->mode   = mode;
 
-  strncpy(req->relpath, relpath, priv->mxwrite);
+  strlcpy(req->relpath, relpath, priv->mxwrite);

Review comment:
       revert, don't need change

##########
File path: fs/rpmsgfs/rpmsgfs.c
##########
@@ -1362,9 +1362,9 @@ int rpmsgfs_rename(FAR struct inode *mountpt, FAR const 
char *oldrelpath,
 
   /* Append to the host's root directory */
 
-  strncpy(oldpath, fs->fs_root, sizeof(oldpath));
+  strlcpy(oldpath, fs->fs_root, sizeof(oldpath));
   strncat(oldpath, oldrelpath, sizeof(oldpath)-strlen(oldpath)-1);
-  strncpy(newpath, fs->fs_root, sizeof(newpath));
+  strlcpy(newpath, fs->fs_root, sizeof(newpath));
   strncat(newpath, newrelpath, sizeof(newpath)-strlen(newpath)-1);

Review comment:
       strlcat(newpath, newrelpath, sizeof(newpath));

##########
File path: fs/nfs/rpc_clnt.c
##########
@@ -588,7 +588,7 @@ int rpcclnt_connect(FAR struct rpcclnt *rpc)
 
   /* Do RPC to mountd. */
 
-  strncpy(request.mountd.mount.rpath, rpc->rc_path, 90);
+  strlcpy(request.mountd.mount.rpath, rpc->rc_path, 90);

Review comment:
       90->sizeof(request.mountd.mount.rpath)

##########
File path: fs/smartfs/smartfs_utils.c
##########
@@ -1056,7 +1055,7 @@ int smartfs_createentry(FAR struct smartfs_mountpt_s *fs,
   entry->utc = time(NULL);
 #endif
   memset(entry->name, 0, fs->fs_llformat.namesize);

Review comment:
       remove

##########
File path: fs/vfs/fs_readlink.c
##########
@@ -107,7 +107,7 @@ ssize_t readlink(FAR const char *path, FAR char *buf, 
size_t bufsize)
   /* Copy the link target pathto the user-provided buffer. */
 
   *buf = '\0';

Review comment:
       remove

##########
File path: fs/nfs/rpc_clnt.c
##########
@@ -716,7 +716,7 @@ void rpcclnt_disconnect(FAR struct rpcclnt *rpc)
 
   /* Do RPC to umountd. */
 
-  strncpy(request.mountd.umount.rpath, rpc->rc_path, 90);
+  strlcpy(request.mountd.umount.rpath, rpc->rc_path, 90);

Review comment:
       90->sizeof(request.mountd.mount.rpath)

##########
File path: fs/hostfs/hostfs.c
##########
@@ -1344,9 +1344,9 @@ int hostfs_rename(FAR struct inode *mountpt, FAR const 
char *oldrelpath,
 
   /* Append to the host's root directory */
 
-  strncpy(oldpath, fs->fs_root, sizeof(oldpath));
+  strlcpy(oldpath, fs->fs_root, sizeof(oldpath));
   strncat(oldpath, oldrelpath, sizeof(oldpath)-strlen(oldpath)-1);

Review comment:
       strlcat(oldpath, oldrelpath, sizeof(oldpath));

##########
File path: fs/rpmsgfs/rpmsgfs_client.c
##########
@@ -587,7 +586,7 @@ int rpmsgfs_client_bind(FAR void **handle, FAR const char 
*cpuname)
       return -ENOMEM;
     }
 
-  strncpy(priv->cpuname, cpuname, RPMSG_NAME_SIZE);
+  strlcpy(priv->cpuname, cpuname, RPMSG_NAME_SIZE);

Review comment:
       RPMSG_NAME_SIZE->sizeof(priv->cpuname)

##########
File path: fs/userfs/fs_userfs.c
##########
@@ -1108,7 +1108,7 @@ static int userfs_opendir(FAR struct inode *mountpt, FAR 
const char *relpath,
   req      = (FAR struct userfs_opendir_request_s *)priv->iobuffer;
   req->req = USERFS_REQ_OPENDIR;
 
-  strncpy(req->relpath, relpath, priv->mxwrite);
+  strlcpy(req->relpath, relpath, priv->mxwrite);

Review comment:
       revert, don't need change

##########
File path: fs/smartfs/smartfs_utils.c
##########
@@ -1102,7 +1101,7 @@ int smartfs_createentry(FAR struct smartfs_mountpt_s *fs,
     }
 
   memset(direntry->name, 0, fs->fs_llformat.namesize + 1);

Review comment:
       remove

##########
File path: fs/rpmsgfs/rpmsgfs.c
##########
@@ -1362,9 +1362,9 @@ int rpmsgfs_rename(FAR struct inode *mountpt, FAR const 
char *oldrelpath,
 
   /* Append to the host's root directory */
 
-  strncpy(oldpath, fs->fs_root, sizeof(oldpath));
+  strlcpy(oldpath, fs->fs_root, sizeof(oldpath));
   strncat(oldpath, oldrelpath, sizeof(oldpath)-strlen(oldpath)-1);

Review comment:
       strlcat(oldpath, oldrelpath, sizeof(oldpath));

##########
File path: fs/userfs/fs_userfs.c
##########
@@ -1674,7 +1674,7 @@ static int userfs_unlink(FAR struct inode *mountpt,
   req      = (FAR struct userfs_unlink_request_s *)priv->iobuffer;
   req->req = USERFS_REQ_UNLINK;
 
-  strncpy(req->relpath, relpath, priv->mxwrite);
+  strlcpy(req->relpath, relpath, priv->mxwrite);

Review comment:
       revert, don't need change

##########
File path: fs/userfs/fs_userfs.c
##########
@@ -1847,7 +1847,7 @@ static int userfs_rmdir(FAR struct inode *mountpt,
   req      = (FAR struct userfs_rmdir_request_s *)priv->iobuffer;
   req->req = USERFS_REQ_RMDIR;
 
-  strncpy(req->relpath, relpath, priv->mxwrite);
+  strlcpy(req->relpath, relpath, priv->mxwrite);

Review comment:
       revert, don't need change

##########
File path: fs/userfs/fs_userfs.c
##########
@@ -2117,7 +2117,7 @@ static int userfs_chstat(FAR struct inode *mountpt, FAR 
const char *relpath,
   req->buf   = *buf;
   req->flags = flags;
 
-  strncpy(req->relpath, relpath, priv->mxwrite);
+  strlcpy(req->relpath, relpath, priv->mxwrite);

Review comment:
       revert, don't need change

##########
File path: fs/userfs/fs_userfs.c
##########
@@ -1761,7 +1761,7 @@ static int userfs_mkdir(FAR struct inode *mountpt,
   req->req  = USERFS_REQ_MKDIR;
   req->mode = mode;
 
-  strncpy(req->relpath, relpath, priv->mxwrite);
+  strlcpy(req->relpath, relpath, priv->mxwrite);

Review comment:
       revert, don't need change

##########
File path: fs/userfs/fs_userfs.c
##########
@@ -2025,7 +2025,7 @@ static int userfs_stat(FAR struct inode *mountpt, FAR 
const char *relpath,
   req      = (FAR struct userfs_stat_request_s *)priv->iobuffer;
   req->req = USERFS_REQ_STAT;
 
-  strncpy(req->relpath, relpath, priv->mxwrite);
+  strlcpy(req->relpath, relpath, priv->mxwrite);

Review comment:
       revert, don't need change




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to