You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2021/02/26 11:09:32 UTC

[GitHub] [mynewt-nimble] sjanc commented on a change in pull request #924: btshell/cmd.c: make strcpy in parse_dev_addr memory safe

sjanc commented on a change in pull request #924:
URL: https://github.com/apache/mynewt-nimble/pull/924#discussion_r583563174



##########
File path: apps/btshell/src/cmd.c
##########
@@ -104,17 +104,23 @@ parse_dev_addr(const char *prefix, const struct kv_pair *addr_types,
     if (!prefix) {
         name[0] = '\0';
     } else {
-        strcpy(name, prefix);
+        if (strlcpy(name, prefix, sizeof(name)) > sizeof(name)) {

Review comment:
       this (and others) should be  >=
   
   
   also, XXX in 102 is no longer needed :)
   




----------------------------------------------------------------
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.

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