This is an automated email from the ASF dual-hosted git repository.
mgorecki pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git
The following commit(s) were added to refs/heads/master by this push:
new d5644bb5c host/store: Fix null pointer dereference
d5644bb5c is described below
commit d5644bb5c2d597117345272c128dd56b60cbcadb
Author: Michal Gorecki <[email protected]>
AuthorDate: Tue Oct 21 14:14:17 2025 +0200
host/store: Fix null pointer dereference
If config_fcb reads an empty string it returns NULL pointer.
We should handle this in ble_store_config module
---
nimble/host/store/config/src/ble_store_config_conf.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/nimble/host/store/config/src/ble_store_config_conf.c
b/nimble/host/store/config/src/ble_store_config_conf.c
index e74127ae9..4090b6020 100644
--- a/nimble/host/store/config/src/ble_store_config_conf.c
+++ b/nimble/host/store/config/src/ble_store_config_conf.c
@@ -91,6 +91,11 @@ ble_store_config_conf_set(int argc, char **argv, char *val)
{
int rc;
+ /* Config returns NULL pointer if it reads an empty string. We change this
back into an empty string. */
+ if (!val) {
+ val = "";
+ }
+
if (argc == 1) {
if (strcmp(argv[0], "our_sec") == 0) {
rc = ble_store_config_deserialize_arr(