Bluetooth: host: Use log_strdup() for stack strings
Prevent temporary strings from being printed incorrectly if they go out of scope before being processed by logger. Signed-off-by: Filip Kubicz <filip.kubicz@nordicsemi.no>
This commit is contained in:
parent
f1a2295088
commit
e44011b6e3
2 changed files with 2 additions and 2 deletions
|
@ -2884,7 +2884,7 @@ static int bt_gatt_store_cf(struct bt_conn *conn)
|
|||
return err;
|
||||
}
|
||||
|
||||
BT_DBG("Stored CF for %s (%s)", bt_addr_le_str(&conn->le.dst), key);
|
||||
BT_DBG("Stored CF for %s (%s)", bt_addr_le_str(&conn->le.dst), log_strdup(key));
|
||||
#endif /* CONFIG_BT_GATT_CACHING */
|
||||
return 0;
|
||||
|
||||
|
|
|
@ -81,7 +81,7 @@ int bt_settings_decode_key(char *key, bt_addr_le_t *addr)
|
|||
}
|
||||
}
|
||||
|
||||
BT_DBG("Decoded %s as %s", key, bt_addr_le_str(addr));
|
||||
BT_DBG("Decoded %s as %s", log_strdup(key), bt_addr_le_str(addr));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue