From ed8c08109f9a4c355ec865a66f38b6068e08d727 Mon Sep 17 00:00:00 2001 From: torlando-tech Date: Wed, 4 Mar 2026 16:20:06 -0500 Subject: [PATCH] Add ble_hs_synced() guard to notifyAll() Matches the guard already on notify() to prevent use-after-free of _tx_char during a NimBLE host reset. Co-Authored-By: Claude Opus 4.6 --- lib/ble_interface/platforms/NimBLEPlatform.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ble_interface/platforms/NimBLEPlatform.cpp b/lib/ble_interface/platforms/NimBLEPlatform.cpp index bc104a33..360e16d7 100644 --- a/lib/ble_interface/platforms/NimBLEPlatform.cpp +++ b/lib/ble_interface/platforms/NimBLEPlatform.cpp @@ -1817,7 +1817,7 @@ bool NimBLEPlatform::notify(uint16_t conn_handle, const Bytes& data) { } bool NimBLEPlatform::notifyAll(const Bytes& data) { - if (!_tx_char) { + if (!ble_hs_synced() || !_tx_char) { return false; }