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/24 09:35:22 UTC

[GitHub] [mynewt-core] KKopyscinski opened a new pull request #2500: hw/sensor: fix possible null dereference in sensor_set_thresh()

KKopyscinski opened a new pull request #2500:
URL: https://github.com/apache/mynewt-core/pull/2500


   Added assert to check if stt is not NULL before dereferencing it


----------------------------------------------------------------
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-core] andrzej-kaczmarek commented on a change in pull request #2500: hw/sensor: fix possible null dereference in sensor_set_thresh()

Posted by GitBox <gi...@apache.org>.
andrzej-kaczmarek commented on a change in pull request #2500:
URL: https://github.com/apache/mynewt-core/pull/2500#discussion_r581803384



##########
File path: hw/sensor/src/sensor.c
##########
@@ -1970,14 +1970,15 @@ sensor_set_thresh(const char *devname, struct sensor_type_traits *stt)
     struct sensor *sensor;
     int rc;
 
+    assert(stt != NULL);

Review comment:
       you should better return error here




----------------------------------------------------------------
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-core] andrzej-kaczmarek commented on a change in pull request #2500: hw/sensor: fix possible null dereference in sensor_set_thresh()

Posted by GitBox <gi...@apache.org>.
andrzej-kaczmarek commented on a change in pull request #2500:
URL: https://github.com/apache/mynewt-core/pull/2500#discussion_r581817358



##########
File path: hw/sensor/src/sensor.c
##########
@@ -1970,14 +1970,19 @@ sensor_set_thresh(const char *devname, struct sensor_type_traits *stt)
     struct sensor *sensor;
     int rc;
 
+    if (stt != NULL) {

Review comment:
       so now I am confused... we want to avoid null dereference or force it? :D
   
   also update commit message




----------------------------------------------------------------
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-core] apache-mynewt-bot removed a comment on pull request #2500: hw/sensor: fix possible null dereference in sensor_set_thresh()

Posted by GitBox <gi...@apache.org>.
apache-mynewt-bot removed a comment on pull request #2500:
URL: https://github.com/apache/mynewt-core/pull/2500#issuecomment-784946350


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

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



[GitHub] [mynewt-core] KKopyscinski merged pull request #2500: hw/sensor: fix possible null dereference in sensor_set_thresh()

Posted by GitBox <gi...@apache.org>.
KKopyscinski merged pull request #2500:
URL: https://github.com/apache/mynewt-core/pull/2500


   


----------------------------------------------------------------
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-core] apache-mynewt-bot removed a comment on pull request #2500: hw/sensor: fix possible null dereference in sensor_set_thresh()

Posted by GitBox <gi...@apache.org>.
apache-mynewt-bot removed a comment on pull request #2500:
URL: https://github.com/apache/mynewt-core/pull/2500#issuecomment-784943807


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

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



[GitHub] [mynewt-core] KKopyscinski commented on a change in pull request #2500: hw/sensor: fix possible null dereference in sensor_set_thresh()

Posted by GitBox <gi...@apache.org>.
KKopyscinski commented on a change in pull request #2500:
URL: https://github.com/apache/mynewt-core/pull/2500#discussion_r581819990



##########
File path: hw/sensor/src/sensor.c
##########
@@ -1970,14 +1970,19 @@ sensor_set_thresh(const char *devname, struct sensor_type_traits *stt)
     struct sensor *sensor;
     int rc;
 
+    if (stt != NULL) {

Review comment:
       avoid null, of course... :)
   updated




----------------------------------------------------------------
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-core] apache-mynewt-bot commented on pull request #2500: hw/sensor: fix possible null dereference in sensor_set_thresh()

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


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

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



[GitHub] [mynewt-core] KKopyscinski commented on a change in pull request #2500: hw/sensor: fix possible null dereference in sensor_set_thresh()

Posted by GitBox <gi...@apache.org>.
KKopyscinski commented on a change in pull request #2500:
URL: https://github.com/apache/mynewt-core/pull/2500#discussion_r581805098



##########
File path: hw/sensor/src/sensor.c
##########
@@ -1970,14 +1970,15 @@ sensor_set_thresh(const char *devname, struct sensor_type_traits *stt)
     struct sensor *sensor;
     int rc;
 
+    assert(stt != NULL);

Review comment:
       done




----------------------------------------------------------------
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-core] apache-mynewt-bot commented on pull request #2500: hw/sensor: fix possible null dereference in sensor_set_thresh()

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


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

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



[GitHub] [mynewt-core] apache-mynewt-bot commented on pull request #2500: hw/sensor: fix possible null dereference in sensor_set_thresh()

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


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

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