From 8bdd23e2ce0cb3074ddf860eb8bea8da06ea210d Mon Sep 17 00:00:00 2001 From: Mariusz Skamra Date: Wed, 15 May 2024 17:00:43 +0200 Subject: [PATCH] nimble/host: Fix invalid connection handle check in SM This fixes invalid conn handle check in SM. The handle 0 is valid connection handle. --- nimble/host/src/ble_sm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nimble/host/src/ble_sm.c b/nimble/host/src/ble_sm.c index 0b7c28db59..bb1dfe0842 100644 --- a/nimble/host/src/ble_sm.c +++ b/nimble/host/src/ble_sm.c @@ -2873,7 +2873,7 @@ ble_sm_rx(struct ble_l2cap_chan *chan) int rc; handle = ble_l2cap_get_conn_handle(chan); - if (!handle) { + if (handle == BLE_HS_CONN_HANDLE_NONE) { return BLE_HS_ENOTCONN; }