You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "flyingfish89 (via GitHub)" <gi...@apache.org> on 2023/02/22 08:36:15 UTC

[GitHub] [nuttx] flyingfish89 opened a new pull request, #8618: change strcpy to strlcpy

flyingfish89 opened a new pull request, #8618:
URL: https://github.com/apache/nuttx/pull/8618

   ## Summary
   change strcpy->strlcpy
   ## Impact
   
   ## Testing
   
   


-- 
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-unsubscribe@nuttx.apache.org

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


[GitHub] [nuttx] xiaoxiang781216 commented on pull request #8618: change strcpy to strlcpy

Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 commented on PR #8618:
URL: https://github.com/apache/nuttx/pull/8618#issuecomment-1441912244

   please rebase to the last master.


-- 
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-unsubscribe@nuttx.apache.org

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


[GitHub] [nuttx] GUIDINGLI merged pull request #8618: change strcpy to strlcpy

Posted by "GUIDINGLI (via GitHub)" <gi...@apache.org>.
GUIDINGLI merged PR #8618:
URL: https://github.com/apache/nuttx/pull/8618


-- 
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-unsubscribe@nuttx.apache.org

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


[GitHub] [nuttx] xiaoxiang781216 commented on a diff in pull request #8618: change strcpy to strlcpy

Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #8618:
URL: https://github.com/apache/nuttx/pull/8618#discussion_r1114681240


##########
fs/rpmsgfs/rpmsgfs_server.c:
##########
@@ -599,6 +599,7 @@ static int rpmsgfs_readdir_handler(FAR struct rpmsg_endpoint *ept,
   FAR struct rpmsgfs_readdir_s *msg = data;
   FAR struct dirent *entry;
   int ret = -ENOENT;
+  size_t size;

Review Comment:
   move after line 603



##########
fs/rpmsgfs/rpmsgfs_server.c:
##########
@@ -607,9 +608,12 @@ static int rpmsgfs_readdir_handler(FAR struct rpmsg_endpoint *ept,
       entry = readdir(dir);
       if (entry)
         {
+          size = MIN(rpmsg_virtio_get_buffer_size(ept->rdev),
+                     rpmsg_virtio_get_rx_buffer_size(ept->rdev));
+          size = MIN(size - len, strlen(entry->d_name) + 1);

Review Comment:
   ```suggestion
             size = MIN(size - len);
   ```



##########
fs/rpmsgfs/rpmsgfs_client.c:
##########
@@ -810,8 +806,7 @@ int rpmsgfs_client_mkdir(FAR void *handle, FAR const char *pathname,
   uint32_t space;
   size_t len;
 
-  len  = sizeof(*msg);
-  len += strlen(pathname) + 1;
+  len  = sizeof(*msg) + strlen(pathname) + 1;

Review Comment:
   remove extra space



##########
fs/rpmsgfs/rpmsgfs_client.c:
##########
@@ -785,8 +782,7 @@ int rpmsgfs_client_unlink(FAR void *handle, FAR const char *pathname)
   uint32_t space;
   size_t len;
 
-  len  = sizeof(*msg);
-  len += strlen(pathname) + 1;
+  len  = sizeof(*msg) + strlen(pathname) + 1;

Review Comment:
   remove extra space



##########
fs/rpmsgfs/rpmsgfs_client.c:
##########
@@ -405,8 +405,7 @@ int rpmsgfs_client_open(FAR void *handle, FAR const char *pathname,
   uint32_t space;
   size_t len;
 
-  len  = sizeof(*msg);
-  len += strlen(pathname) + 1;
+  len  = sizeof(*msg) + strlen(pathname) + 1;

Review Comment:
   remove extra space



##########
fs/rpmsgfs/rpmsgfs_client.c:
##########
@@ -651,8 +650,7 @@ FAR void *rpmsgfs_client_opendir(FAR void *handle, FAR const char *name)
   size_t len;
   int ret;
 
-  len  = sizeof(*msg);
-  len += strlen(name) + 1;
+  len  = sizeof(*msg) + strlen(name) + 1;

Review Comment:
   remove extra space



##########
fs/rpmsgfs/rpmsgfs_client.c:
##########
@@ -889,8 +883,7 @@ int rpmsgfs_client_stat(FAR void *handle, FAR const char *path,
   uint32_t space;
   size_t len;
 
-  len  = sizeof(*msg);
-  len += strlen(path) + 1;
+  len  = sizeof(*msg) + strlen(path) + 1;

Review Comment:
   remove extra space



##########
fs/rpmsgfs/rpmsgfs_client.c:
##########
@@ -928,8 +921,7 @@ int rpmsgfs_client_chstat(FAR void *handle, FAR const char *path,
   uint32_t space;
   size_t len;
 
-  len  = sizeof(*msg);
-  len += strlen(path) + 1;
+  len  = sizeof(*msg) + strlen(path) + 1;

Review Comment:
   remove extra space



##########
fs/rpmsgfs/rpmsgfs_client.c:
##########
@@ -761,8 +759,7 @@ int rpmsgfs_client_statfs(FAR void *handle, FAR const char *path,
   uint32_t space;
   size_t len;
 
-  len  = sizeof(*msg);
-  len += strlen(path) + 1;
+  len  = sizeof(*msg) + strlen(path) + 1;

Review Comment:
   remove extra space



##########
drivers/eeprom/i2c_xx24xx.c:
##########
@@ -887,7 +889,7 @@ int ee24xx_initialize(FAR struct i2c_master_s *bus, uint8_t devaddr,
    * EEPROM chip, but with the ".uuid" suffix
    */
 
-  strcpy(uuidname, devname);
+  strlcpy(uuidname, devname, size);
   strcat(uuidname, ".uuid");

Review Comment:
   strcat->strlcat



-- 
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-unsubscribe@nuttx.apache.org

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


[GitHub] [nuttx] GUIDINGLI commented on pull request #8618: change strcpy to strlcpy

Posted by "GUIDINGLI (via GitHub)" <gi...@apache.org>.
GUIDINGLI commented on PR #8618:
URL: https://github.com/apache/nuttx/pull/8618#issuecomment-1441662630

   base on https://github.com/apache/nuttx/pull/8629


-- 
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-unsubscribe@nuttx.apache.org

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