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/10/22 14:47:31 UTC

[GitHub] [incubator-nuttx] xiaoxiang781216 opened a new pull request, #7394: Fix bcmf_netdev.c:705:7: error: 'strnlen' specified bound 2 exceeds source size 1 [-Werror=stringop-overread]

xiaoxiang781216 opened a new pull request, #7394:
URL: https://github.com/apache/incubator-nuttx/pull/7394

   ## Summary
   Report here: https://github.com/apache/incubator-nuttx-apps/actions/runs/3303013192/jobs/5450504682
   
   ## Impact
   Minor
   
   ## Testing
   Pass CI
   


-- 
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 diff in pull request #7394: Fix bcmf_netdev.c:705:7: error: 'strnlen' specified bound 2 exceeds source size 1 [-Werror=stringop-overread]

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on code in PR #7394:
URL: https://github.com/apache/incubator-nuttx/pull/7394#discussion_r1002549390


##########
drivers/wireless/ieee80211/bcm43xxx/bcmf_netdev.c:
##########
@@ -702,7 +702,7 @@ static int bcmf_ifup(FAR struct net_driver_s *dev)
       goto errout_in_wl_active;
     }
 
-  if (strnlen(CONFIG_IEEE80211_BROADCOM_DEFAULT_COUNTRY, 2) == 2)
+  if (CONFIG_IEEE80211_BROADCOM_DEFAULT_COUNTRY[0])

Review Comment:
   I think we do not need check for constant as it will be caught at compile 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@nuttx.apache.org

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


[GitHub] [incubator-nuttx] acassis commented on a diff in pull request #7394: Fix bcmf_netdev.c:705:7: error: 'strnlen' specified bound 2 exceeds source size 1 [-Werror=stringop-overread]

Posted by GitBox <gi...@apache.org>.
acassis commented on code in PR #7394:
URL: https://github.com/apache/incubator-nuttx/pull/7394#discussion_r1002513560


##########
drivers/wireless/ieee80211/bcm43xxx/bcmf_netdev.c:
##########
@@ -702,7 +702,7 @@ static int bcmf_ifup(FAR struct net_driver_s *dev)
       goto errout_in_wl_active;
     }
 
-  if (strnlen(CONFIG_IEEE80211_BROADCOM_DEFAULT_COUNTRY, 2) == 2)
+  if (CONFIG_IEEE80211_BROADCOM_DEFAULT_COUNTRY[0])

Review Comment:
   Right, but protection is always welcome! ;-)



-- 
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 diff in pull request #7394: Fix bcmf_netdev.c:705:7: error: 'strnlen' specified bound 2 exceeds source size 1 [-Werror=stringop-overread]

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #7394:
URL: https://github.com/apache/incubator-nuttx/pull/7394#discussion_r1002526193


##########
drivers/wireless/ieee80211/bcm43xxx/bcmf_netdev.c:
##########
@@ -702,7 +702,7 @@ static int bcmf_ifup(FAR struct net_driver_s *dev)
       goto errout_in_wl_active;
     }
 
-  if (strnlen(CONFIG_IEEE80211_BROADCOM_DEFAULT_COUNTRY, 2) == 2)
+  if (CONFIG_IEEE80211_BROADCOM_DEFAULT_COUNTRY[0])

Review Comment:
   But it's a compile time constant, compiler can report the abnormal usage.



-- 
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 diff in pull request #7394: Fix bcmf_netdev.c:705:7: error: 'strnlen' specified bound 2 exceeds source size 1 [-Werror=stringop-overread]

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #7394:
URL: https://github.com/apache/incubator-nuttx/pull/7394#discussion_r1002509319


##########
drivers/wireless/ieee80211/bcm43xxx/bcmf_netdev.c:
##########
@@ -702,7 +702,7 @@ static int bcmf_ifup(FAR struct net_driver_s *dev)
       goto errout_in_wl_active;
     }
 
-  if (strnlen(CONFIG_IEEE80211_BROADCOM_DEFAULT_COUNTRY, 2) == 2)
+  if (CONFIG_IEEE80211_BROADCOM_DEFAULT_COUNTRY[0])

Review Comment:
   You can't, CONFIG_IEEE80211_BROADCOM_DEFAULT_COUNTRY come from Kconfig, the minimum value is "".



-- 
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] acassis commented on a diff in pull request #7394: Fix bcmf_netdev.c:705:7: error: 'strnlen' specified bound 2 exceeds source size 1 [-Werror=stringop-overread]

Posted by GitBox <gi...@apache.org>.
acassis commented on code in PR #7394:
URL: https://github.com/apache/incubator-nuttx/pull/7394#discussion_r1002501720


##########
drivers/wireless/ieee80211/bcm43xxx/bcmf_netdev.c:
##########
@@ -702,7 +702,7 @@ static int bcmf_ifup(FAR struct net_driver_s *dev)
       goto errout_in_wl_active;
     }
 
-  if (strnlen(CONFIG_IEEE80211_BROADCOM_DEFAULT_COUNTRY, 2) == 2)
+  if (CONFIG_IEEE80211_BROADCOM_DEFAULT_COUNTRY[0])

Review Comment:
   I think it could generate an error if CONFIG_IEEE80211_BROADCOM_DEFAULT_COUNTRY is null



##########
drivers/wireless/ieee80211/bcm43xxx/bcmf_netdev.c:
##########
@@ -702,7 +702,7 @@ static int bcmf_ifup(FAR struct net_driver_s *dev)
       goto errout_in_wl_active;
     }
 
-  if (strnlen(CONFIG_IEEE80211_BROADCOM_DEFAULT_COUNTRY, 2) == 2)
+  if (CONFIG_IEEE80211_BROADCOM_DEFAULT_COUNTRY[0])

Review Comment:
   ```suggestion
     if (CONFIG_IEEE80211_BROADCOM_DEFAULT_COUNTRY != NULL &&
         CONFIG_IEEE80211_BROADCOM_DEFAULT_COUNTRY[0])



-- 
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 pull request #7394: Fix bcmf_netdev.c:705:7: error: 'strnlen' specified bound 2 exceeds source size 1 [-Werror=stringop-overread]

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on PR #7394:
URL: https://github.com/apache/incubator-nuttx/pull/7394#issuecomment-1287873207

   Merging this to resolve dependency on apps repo


-- 
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 merged pull request #7394: Fix bcmf_netdev.c:705:7: error: 'strnlen' specified bound 2 exceeds source size 1 [-Werror=stringop-overread]

Posted by GitBox <gi...@apache.org>.
pkarashchenko merged PR #7394:
URL: https://github.com/apache/incubator-nuttx/pull/7394


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