Skip to content

Commit d5644bb

Browse files
committed
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
1 parent 3881e2c commit d5644bb

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

nimble/host/store/config/src/ble_store_config_conf.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,11 @@ ble_store_config_conf_set(int argc, char **argv, char *val)
9191
{
9292
int rc;
9393

94+
/* Config returns NULL pointer if it reads an empty string. We change this back into an empty string. */
95+
if (!val) {
96+
val = "";
97+
}
98+
9499
if (argc == 1) {
95100
if (strcmp(argv[0], "our_sec") == 0) {
96101
rc = ble_store_config_deserialize_arr(

0 commit comments

Comments
 (0)