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

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

commit 0bf6891c928d7636e3b6d4378b3f71d1d86ecc9b
Author: Szymon Janc <[email protected]>
AuthorDate: Mon Oct 19 23:46:08 2026 +0200

    nimble/ll: Add missing advertising instance check
    
    ble_ll_adv_sm_get() may return NULL, but its result was not checked in
    LE Set Extended Advertising Parameters v2 command handler. Check it as
    it is done in v1 command handler.
    
    Assisted-by: Claude:claude-opus-5-5
---
 nimble/controller/src/ble_ll_adv.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/nimble/controller/src/ble_ll_adv.c 
b/nimble/controller/src/ble_ll_adv.c
index 9da714aac..1d08c5d6c 100644
--- a/nimble/controller/src/ble_ll_adv.c
+++ b/nimble/controller/src/ble_ll_adv.c
@@ -3755,6 +3755,9 @@ ble_ll_adv_ext_set_param_v2(const uint8_t *cmdbuf, 
uint8_t len,
     }
 
     advsm = ble_ll_adv_sm_get(cmd->params_v1.adv_handle);
+    if (!advsm) {
+        return BLE_ERR_MEM_CAPACITY;
+    }
 
     if (advsm->pri_phy == BLE_HCI_LE_PHY_CODED) {
         advsm->pri_phy_opt = ble_ll_adv_convert_phy_opt(cmd->pri_phy_opt);

Reply via email to