frameworks_bluetooth/framework/common
v-chenghuijin 5e83175f35 fix: prevent crash by ensuring non-null string for sched_note_printf
bug: v/84212

Rootcase: The lightweight sched_note_printf function in the NuttX backend does not
perform NULL safety checks for the %s format specifier. Passing a NULL pointer from
hsm_get_state_name leads to a NULL pointer dereference, triggering a data abort
exception on systems with memory protection (MMU/MPU) and causing a system crash.

Solution: This commit addresses the issue by modifying the HSM_SAFE_NAME macro to
use the ternary operator. It now explicitly returns the "None" string literal when
hsm_get_state_name returns NULL, guaranteeing that a valid, non-null C-string is always
passed to the logging function.

Signed-off-by: v-chenghuijin <v-chenghuijin@xiaomi.com>
2026-04-27 23:14:54 +08:00
..
advertiser_data.c Merge commit 2026-04-27 23:14:50 +08:00
advertiser_data_helper.c Merge commit 2026-04-27 23:14:50 +08:00
bt_addr.c addr: fix bt_addr_str multiple define 2026-04-27 23:14:50 +08:00
bt_hash.c bluetooth: add le scan dup feature 2026-04-20 14:51:15 +08:00
bt_hash.h Move the internal header files out to include common 2026-04-27 23:14:52 +08:00
bt_internal.h Move the internal header files out to include common 2026-04-27 23:14:52 +08:00
bt_list.c Bluetooth: add free after list_delete to avoid memory leak. 2026-04-20 14:51:09 +08:00
bt_time.c Rename helper func get_os_timestamp_xx to bt_get_os_timestamp_xx avoid 2026-04-20 14:51:29 +08:00
bt_trace.h Move the internal header files out to include common 2026-04-27 23:14:52 +08:00
bt_uuid.c Vela-Android: save bredr remote uuids 2026-04-27 23:14:51 +08:00
callbacks_list.c Handles cllbacks free work in the client thread. 2026-04-20 14:51:14 +08:00
euv_pipe.c Bluetooth: Fixed an issue where resources could not be released after closing uv_pipe in euv_pipe. 2026-04-27 23:14:54 +08:00
euv_pty.c Clang-format: Update format of all files based on new .clang-format 2026-04-20 14:50:50 +08:00
state_machine.c fix: prevent crash by ensuring non-null string for sched_note_printf 2026-04-27 23:14:54 +08:00
uv_thread_loop.c Merge commit 2026-04-27 23:14:50 +08:00