From: Yun-Hao Chung <howardchung@xxxxxxxxxxxx> |str| can be NULL in the case of reading lm value. Calling strcasestr could lead to a crash. Reviewed-by: Archie Pusaka <apusaka@xxxxxxxxxxxx> --- Verified by running "hciconfig hci0 lm" on hatch lib/hci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/hci.c b/lib/hci.c index 5141f20ac..5228c2ad2 100644 --- a/lib/hci.c +++ b/lib/hci.c @@ -323,7 +323,7 @@ int hci_strtolm(char *str, unsigned int *val) int ret = hci_str2bit(link_mode_map, str, val); /* Deprecated name. Kept for compatibility. */ - if (strcasestr(str, "MASTER")) { + if (!!str && strcasestr(str, "MASTER")) { ret = 1; *val |= HCI_LM_MASTER; } -- 2.35.1.265.g69c8d7142f-goog