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 2022/06/27 15:56:14 UTC

[GitHub] [mynewt-core] sjanc opened a new pull request, #2856: net/ip/native_socks: Fix build on with -Werror=stringop-overflow

sjanc opened a new pull request, #2856:
URL: https://github.com/apache/mynewt-core/pull/2856

   Werror=stringop-overflow= seems to be now enabled by default on GCC 11.
   
   repos/apache-mynewt-core/net/ip/native_sockets/src/native_sock.c: In
       function ‘native_sock_mn_addr_to_addr’:
   repos/apache-mynewt-core/net/ip/native_sockets/src/native_sock.c:199:9:
       error: ‘strncat’ specified bound 108 equals destination size
       [-Werror=stringop-overflow=]
     199 |         strncat(sun->sun_path, msun->msun_path,
                           sizeof sun->sun_path);
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   cc1: all warnings being treated as errors


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

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


[GitHub] [mynewt-core] apache-mynewt-bot commented on pull request #2856: net/ip/native_socks: Fix build on with -Werror=stringop-overflow

Posted by GitBox <gi...@apache.org>.
apache-mynewt-bot commented on PR #2856:
URL: https://github.com/apache/mynewt-core/pull/2856#issuecomment-1167639163

   
   <!-- style-bot -->
   
   ## Style check summary
   
   #### No suggestions at this time!
   


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

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


[GitHub] [mynewt-core] sjanc merged pull request #2856: net/ip/native_socks: Fix build on with -Werror=stringop-overflow

Posted by GitBox <gi...@apache.org>.
sjanc merged PR #2856:
URL: https://github.com/apache/mynewt-core/pull/2856


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

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


[GitHub] [mynewt-core] kasjer commented on a diff in pull request #2856: net/ip/native_socks: Fix build on with -Werror=stringop-overflow

Posted by GitBox <gi...@apache.org>.
kasjer commented on code in PR #2856:
URL: https://github.com/apache/mynewt-core/pull/2856#discussion_r908085008


##########
net/ip/native_sockets/src/native_sock.c:
##########
@@ -196,7 +196,7 @@ native_sock_mn_addr_to_addr(struct mn_sockaddr *ms, struct sockaddr *sa,
         sun->sun_len = sizeof(*sun);
 #endif
         sun->sun_path[0] = '\0';
-        strncat(sun->sun_path, msun->msun_path, sizeof sun->sun_path);
+        strncat(sun->sun_path, msun->msun_path, sizeof (sun->sun_path) - 1);

Review Comment:
   `sizeof(` is predominant (over `sizeof (`)in mynewt including this file 3 lines above sizeof(*sum)



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

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