All of lore.kernel.org
 help / color / mirror / Atom feed
* [Bluez PATCH v1] lib: fix hci_strtolm crash
@ 2022-02-14  9:13 Howard Chung
  2022-02-14 10:39 ` [Bluez,v1] " bluez.test.bot
  0 siblings, 1 reply; 2+ messages in thread
From: Howard Chung @ 2022-02-14  9:13 UTC (permalink / raw)
  To: linux-bluetooth, luiz.dentz; +Cc: Yun-Hao Chung, Archie Pusaka

From: Yun-Hao Chung <howardchung@chromium.org>

|str| can be NULL in the case of reading lm value. Calling strcasestr
could lead to a crash.

Reviewed-by: Archie Pusaka <apusaka@chromium.org>
---
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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* RE: [Bluez,v1] lib: fix hci_strtolm crash
  2022-02-14  9:13 [Bluez PATCH v1] lib: fix hci_strtolm crash Howard Chung
@ 2022-02-14 10:39 ` bluez.test.bot
  0 siblings, 0 replies; 2+ messages in thread
From: bluez.test.bot @ 2022-02-14 10:39 UTC (permalink / raw)
  To: linux-bluetooth, howardchung

[-- Attachment #1: Type: text/plain, Size: 997 bytes --]

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=614021

---Test result---

Test Summary:
CheckPatch                    PASS      1.45 seconds
GitLint                       PASS      0.99 seconds
Prep - Setup ELL              PASS      48.69 seconds
Build - Prep                  PASS      0.86 seconds
Build - Configure             PASS      10.41 seconds
Build - Make                  PASS      1734.15 seconds
Make Check                    PASS      12.61 seconds
Make Check w/Valgrind         PASS      513.86 seconds
Make Distcheck                PASS      274.19 seconds
Build w/ext ELL - Configure   PASS      10.20 seconds
Build w/ext ELL - Make        PASS      1758.78 seconds
Incremental Build with patchesPASS      0.00 seconds



---
Regards,
Linux Bluetooth


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-02-14 11:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-14  9:13 [Bluez PATCH v1] lib: fix hci_strtolm crash Howard Chung
2022-02-14 10:39 ` [Bluez,v1] " bluez.test.bot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.