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

Re: BlueZ hciconfig: Segmentation Fault

From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
Date: 2021-11-11 00:29:29

Hi Jay,

On Wed, Nov 10, 2021 at 7:47 AM Jay Foster [off-list ref] wrote:
quoted hunk ↗ jump to hunk
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;
      }
You will probably need to rebase:

Applying: BlueZ hciconfig: Segmentation Fault
error: lib/hci.c    2021-11-08 09:19:59.880207913 -0800: does not exist in index
Patch failed at 0001 BlueZ hciconfig: Segmentation Fault


-- 
Luiz Augusto von Dentz
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help