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/11 13:03:57 UTC

[GitHub] [mynewt-mcumgr] de-nordic opened a new pull request #109: mgmt: Uninitialized prev pointer may cause compilation warnings

de-nordic opened a new pull request #109:
URL: https://github.com/apache/mynewt-mcumgr/pull/109


   Seen while compiling mcumgr with Zephyr: compilation claims possible
   dereferencing of uninitialized prev pointer.
   This is not possible situation as the dereferencing of prev depends on
   curr pointer not being null, otherwise the code will exit prior to "faulty"
   dereference.
   
   Signed-off-by: Dominik Ermel <do...@nordicsemi.no>


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



[GitHub] [mynewt-mcumgr] de-nordic closed pull request #109: mgmt: Uninitialized prev pointer may cause compilation warnings

Posted by GitBox <gi...@apache.org>.
de-nordic closed pull request #109:
URL: https://github.com/apache/mynewt-mcumgr/pull/109


   


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



[GitHub] [mynewt-mcumgr] utzig commented on a change in pull request #109: mgmt: Uninitialized prev pointer may cause compilation warnings

Posted by GitBox <gi...@apache.org>.
utzig commented on a change in pull request #109:
URL: https://github.com/apache/mynewt-mcumgr/pull/109#discussion_r574487942



##########
File path: mgmt/src/mgmt.c
##########
@@ -74,7 +74,7 @@ mgmt_streamer_free_buf(struct mgmt_streamer *streamer, void *buf)
 void
 mgmt_unregister_group(struct mgmt_group *group)
 {
-    struct mgmt_group *curr = mgmt_group_list, *prev;
+    struct mgmt_group *curr = mgmt_group_list, *prev = NULL;

Review comment:
       This might fix the warning but it still could break when doing the `prev->mg_next = curr->mg_next;` below. I submitted a review for the original PR and would prefer a fix like suggested.




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



[GitHub] [mynewt-mcumgr] de-nordic commented on pull request #109: mgmt: Uninitialized prev pointer may cause compilation warnings

Posted by GitBox <gi...@apache.org>.
de-nordic commented on pull request #109:
URL: https://github.com/apache/mynewt-mcumgr/pull/109#issuecomment-777441121


   @vrahane can you look at this?


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



[GitHub] [mynewt-mcumgr] de-nordic commented on pull request #109: mgmt: Uninitialized prev pointer may cause compilation warnings

Posted by GitBox <gi...@apache.org>.
de-nordic commented on pull request #109:
URL: https://github.com/apache/mynewt-mcumgr/pull/109#issuecomment-777474514


   @utzig I am leaving that to you as you have alread reported your concerns with the original code.


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