casaroli commented on code in PR #20853:
URL: https://github.com/apache/nuttx/pull/20853#discussion_r4435016950
##########
sched/task/task_setup.c:
##########
@@ -45,6 +45,16 @@
#include "group/group.h"
#include "task/task.h"
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+#if CONFIG_TASK_MAX_ARGS < 4
Review Comment:
`CONFIG_TASK_MAX_ARGS` has `range 16 65536` in sched/Kconfig, so the `< 4`
branch is never used, and the commit message says the limit "may be as large as
256"; it is now 65536.
Fix: define `NXTASK_ARG_LEN_CACHE_SIZE` as 4 with one comment line that says
why 4, and correct the commit message.
##########
sched/task/task_setup.c:
##########
@@ -604,8 +625,8 @@ int nxtask_setup_stackargs(FAR struct tcb_s *tcb,
*/
stackargv[0] = str;
- nbytes = strlen(name) + 1;
- strlcpy(str, name, strtablen);
+ nbytes = namelen;
+ memcpy(str, name, nbytes);
str += nbytes;
strtablen -= nbytes;
Review Comment:
`strtablen` is not read after this line any more, because the copy loop no
longer uses it.
Fix: remove this store.
--
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]