Skip to content

Commit 16311e2

Browse files
Johan Hedbergjhedberg
authored andcommitted
Bluetooth: settings: Fix missing log_strdup() call
The bt_settings_encode_key() cannot know if the given path pointer is on the stack or not, so the only safe way to pass it to the logger is by using a log_strdup() call. Not doing this will likely cause corrupted strings to show up in the log output. Signed-off-by: Johan Hedberg <[email protected]>
1 parent 1350de9 commit 16311e2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

subsys/bluetooth/host/settings.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ void bt_settings_encode_key(char *path, size_t path_size, const char *subsys,
4040
addr->type);
4141
}
4242

43-
BT_DBG("Encoded path %s", path);
43+
BT_DBG("Encoded path %s", log_strdup(path));
4444
}
4545

4646
int bt_settings_decode_key(char *key, bt_addr_le_t *addr)

0 commit comments

Comments
 (0)