Thread (3 messages) flat view 3 messages, 2 authors, 2021-11-11

BlueZ hciconfig: Segmentation Fault

From: Jay Foster <hidden>
Date: 2021-11-10 15:47:06

From: Jay Foster <redacted>

hciconfig segfaults in the Bluez 5.62 release.

The 'hciconfig lm' command, used to show the current link mode settings,
de-references a NULL pointer when calling strcasestr().  This results in
a segmentation fault.  This is a regression in release 5.62 from the updates
to implement the appropriate language changes.

The hci_str2bit() function handles a NULL str value, but strcasestr() 
does not.

Signed-off-by: Jay Foster <redacted>
--- a/lib/hci.c    2021-10-13 11:38:34.000000000 -0700
+++ b/lib/hci.c    2021-11-08 09:19:59.880207913 -0800
@@ -323,7 +323,7 @@ int hci_strtolm(char *str, unsigned int
      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;
      }
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help