Message ID | 20220214171329.Bluez.v1.1.I8c72b5af2506378bba6da369228ae50483231e35@changeid |
---|---|
State | New |
Headers | show |
Series | [Bluez,v1] lib: fix hci_strtolm crash | expand |
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; }