xiaoxiang781216 commented on code in PR #1623:
URL: https://github.com/apache/nuttx-apps/pull/1623#discussion_r1156227458


##########
netutils/ftpd/ftpd.c:
##########
@@ -1470,16 +1471,18 @@ static FAR char *ftpd_node2path(FAR struct 
ftpd_pathnode_s *node,
         {
           if (namelen <= 0)
             {
-              allocsize += sprintf(&path[allocsize], "/");
+              next += snprintf(&path[next], allocsize - next, "/");

Review Comment:
   > general notice: we should not add `snprintf` result as:
   > 
   > 1. it can be -1
   
   It's impossible with the right format string and parameter
   
   > 2. it can be bigger than size passed as second parameter.
   
   Fix.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to