You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by ja...@apache.org on 2021/12/08 13:27:28 UTC

[mynewt-nimble] branch master updated (6b40986 -> 64b7402)

This is an automated email from the ASF dual-hosted git repository.

janc pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git.


    from 6b40986  porting: Allow to build with -Wcast-align
     new 5e94b1b  nimble/ll: Fix not validating no-param HCI commands sizes
     new 64b7402  nimble/ll: Fix typo in ble_ll_read_rf_path_compensation

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 nimble/controller/src/ble_ll_hci.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

[mynewt-nimble] 01/02: nimble/ll: Fix not validating no-param HCI commands sizes

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

janc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git

commit 5e94b1b85a798ff17ad3ccc0879d676a11deae6f
Author: Szymon Janc <sz...@codecoup.pl>
AuthorDate: Mon Dec 6 16:16:58 2021 +0100

    nimble/ll: Fix not validating no-param HCI commands sizes
    
    If command has no input parameters its size should be verified before
    passing it to handler function.
---
 nimble/controller/src/ble_ll_hci.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/nimble/controller/src/ble_ll_hci.c b/nimble/controller/src/ble_ll_hci.c
index 0e92939..c59137a 100644
--- a/nimble/controller/src/ble_ll_hci.c
+++ b/nimble/controller/src/ble_ll_hci.c
@@ -1152,10 +1152,14 @@ ble_ll_hci_le_cmd_proc(const uint8_t *cmdbuf, uint8_t len, uint16_t ocf,
 #endif
 #endif
     case BLE_HCI_OCF_LE_RD_TRANSMIT_POWER:
-        rc = ble_ll_read_tx_power(rspbuf, rsplen);
+        if (len == 0) {
+            rc = ble_ll_read_tx_power(rspbuf, rsplen);
+        }
         break;
     case BLE_HCI_OCF_LE_RD_RF_PATH_COMPENSATION:
-        rc = ble_ll_read_rf_path_compensation(rspbuf, rsplen);
+        if (len == 0) {
+            rc = ble_ll_read_rf_path_compensation(rspbuf, rsplen);
+        }
         break;
     case BLE_HCI_OCF_LE_WR_RF_PATH_COMPENSATION:
         rc = ble_ll_write_rf_path_compensation(cmdbuf, len);
@@ -1217,7 +1221,9 @@ ble_ll_hci_le_cmd_proc(const uint8_t *cmdbuf, uint8_t len, uint16_t ocf,
         rc = ble_ll_iso_remove_iso_data_path(cmdbuf, len);
         break;
     case BLE_HCI_OCF_LE_RD_BUF_SIZE_V2:
-        rc = ble_ll_hci_le_read_bufsize_v2(rspbuf, rsplen);
+        if (len == 0) {
+            rc = ble_ll_hci_le_read_bufsize_v2(rspbuf, rsplen);
+        }
         break;
 #endif
 #if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_ISO_TEST)

[mynewt-nimble] 02/02: nimble/ll: Fix typo in ble_ll_read_rf_path_compensation

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

janc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git

commit 64b74026961663f9172f90559f75975808ebae62
Author: Szymon Janc <sz...@codecoup.pl>
AuthorDate: Mon Dec 6 16:18:24 2021 +0100

    nimble/ll: Fix typo in ble_ll_read_rf_path_compensation
    
    ;; are not needed here
---
 nimble/controller/src/ble_ll_hci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/nimble/controller/src/ble_ll_hci.c b/nimble/controller/src/ble_ll_hci.c
index c59137a..e3e558e 100644
--- a/nimble/controller/src/ble_ll_hci.c
+++ b/nimble/controller/src/ble_ll_hci.c
@@ -786,7 +786,7 @@ ble_ll_read_rf_path_compensation(uint8_t *rspbuf, uint8_t *rsplen)
     rsp->rx_path_compensation = htole16(rx_path_pwr_compensation);
     rsp->tx_path_compensation = htole16(tx_path_pwr_compensation);
 
-    *rsplen = sizeof(*rsp);;
+    *rsplen = sizeof(*rsp);
     return BLE_ERR_SUCCESS;
 }