DORMANTno replies

[PATCH] avoid garbled names and segmentation faults in "hcitool scan" command

From: Bisseling <hidden>
Date: 2021-10-20 12:11:37
Subsystem: the rest · Maintainer: Linus Torvalds

diff --git a/tools/hcitool.c b/tools/hcitool.c
index b6f4a4e66..11e2f7841 100644
--- a/tools/hcitool.c
+++ b/tools/hcitool.c
@@ -673,8 +673,8 @@ static void cmd_scan(int dev_id, int argc, char **argv)
                                 strcpy(name, "n/a");

                         for (n = 0; n < 248 && name[n]; n++) {
-                               if ((unsigned char) name[i] < 32 ||
name[i] == 127)
-                                       name[i] = '.';
+                               if ((unsigned char) name[n] < 32 ||
name[n] == 127)
+                                       name[n] = '.';
                         }

                         name[248] = '\0';

Attachments

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