You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/04/01 13:22:22 UTC
[GitHub] [incubator-nuttx] zhuyanlinzyl opened a new pull request #5953: fix coverify warning
zhuyanlinzyl opened a new pull request #5953:
URL: https://github.com/apache/incubator-nuttx/pull/5953
## Summary
fix coverify warning
## 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] [incubator-nuttx] pkarashchenko commented on a change in pull request #5953: fix coverify warning
Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on a change in pull request #5953:
URL: https://github.com/apache/incubator-nuttx/pull/5953#discussion_r840781724
##########
File path: sched/sched/sched_note.c
##########
@@ -494,7 +494,7 @@ void sched_note_start(FAR struct tcb_s *tcb)
namelen = strlen(tcb->name);
DEBUGASSERT(namelen <= CONFIG_TASK_NAME_SIZE);
- strncpy(note.nsa_name, tcb->name, CONFIG_TASK_NAME_SIZE + 1);
+ strlcpy(note.nsa_name, tcb->name, CONFIG_TASK_NAME_SIZE + 1);
Review comment:
Then maybe switch to sizeof?
--
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] [incubator-nuttx] pkarashchenko commented on a change in pull request #5953: fix coverify warning
Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on a change in pull request #5953:
URL: https://github.com/apache/incubator-nuttx/pull/5953#discussion_r840754701
##########
File path: sched/sched/sched_note.c
##########
@@ -494,7 +494,7 @@ void sched_note_start(FAR struct tcb_s *tcb)
namelen = strlen(tcb->name);
DEBUGASSERT(namelen <= CONFIG_TASK_NAME_SIZE);
- strncpy(note.nsa_name, tcb->name, CONFIG_TASK_NAME_SIZE + 1);
+ strlcpy(note.nsa_name, tcb->name, CONFIG_TASK_NAME_SIZE + 1);
Review comment:
Should we remove +1 now?
--
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] [incubator-nuttx] xiaoxiang781216 commented on a change in pull request #5953: fix coverify warning
Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on a change in pull request #5953:
URL: https://github.com/apache/incubator-nuttx/pull/5953#discussion_r840765395
##########
File path: sched/sched/sched_note.c
##########
@@ -494,7 +494,7 @@ void sched_note_start(FAR struct tcb_s *tcb)
namelen = strlen(tcb->name);
DEBUGASSERT(namelen <= CONFIG_TASK_NAME_SIZE);
- strncpy(note.nsa_name, tcb->name, CONFIG_TASK_NAME_SIZE + 1);
+ strlcpy(note.nsa_name, tcb->name, CONFIG_TASK_NAME_SIZE + 1);
Review comment:
no, since note.nsa_name contain `CONFIG_TASK_NAME_SIZE + 1`'s char,
--
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] [incubator-nuttx] xiaoxiang781216 commented on a change in pull request #5953: fix coverify warning
Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on a change in pull request #5953:
URL: https://github.com/apache/incubator-nuttx/pull/5953#discussion_r840788283
##########
File path: sched/sched/sched_note.c
##########
@@ -494,7 +494,7 @@ void sched_note_start(FAR struct tcb_s *tcb)
namelen = strlen(tcb->name);
DEBUGASSERT(namelen <= CONFIG_TASK_NAME_SIZE);
- strncpy(note.nsa_name, tcb->name, CONFIG_TASK_NAME_SIZE + 1);
+ strlcpy(note.nsa_name, tcb->name, CONFIG_TASK_NAME_SIZE + 1);
Review comment:
yes, could be.
--
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] [incubator-nuttx] xiaoxiang781216 commented on a change in pull request #5953: fix coverify warning
Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on a change in pull request #5953:
URL: https://github.com/apache/incubator-nuttx/pull/5953#discussion_r840765395
##########
File path: sched/sched/sched_note.c
##########
@@ -494,7 +494,7 @@ void sched_note_start(FAR struct tcb_s *tcb)
namelen = strlen(tcb->name);
DEBUGASSERT(namelen <= CONFIG_TASK_NAME_SIZE);
- strncpy(note.nsa_name, tcb->name, CONFIG_TASK_NAME_SIZE + 1);
+ strlcpy(note.nsa_name, tcb->name, CONFIG_TASK_NAME_SIZE + 1);
Review comment:
no, since note.nsa_name contain `CONFIG_TASK_NAME_SIZE + 1`'s char.
--
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] [incubator-nuttx] pkarashchenko commented on a change in pull request #5953: fix coverify warning
Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on a change in pull request #5953:
URL: https://github.com/apache/incubator-nuttx/pull/5953#discussion_r841011558
##########
File path: sched/module/mod_insmod.c
##########
@@ -198,9 +198,11 @@ FAR void *insmod(FAR const char *filename, FAR const char *modname)
goto errout_with_loadinfo;
}
+#ifdef HAVE_MODLIB_NAMES
/* Save the module name in the registry entry */
strlcpy(modp->modname, modname, MODLIB_NAMEMAX);
Review comment:
```suggestion
strlcpy(modp->modname, modname, sizeof(modp->modname));
```
--
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] [incubator-nuttx] xiaoxiang781216 merged pull request #5953: fix coverify warning
Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 merged pull request #5953:
URL: https://github.com/apache/incubator-nuttx/pull/5953
--
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