linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [Bluez PATCH] lib/uuid: Fix string to uuid32 conversion
@ 2021-05-19  8:21 Archie Pusaka
  2021-05-19  8:45 ` [Bluez] " bluez.test.bot
  2021-05-23 16:24 ` [Bluez PATCH] " Archie Pusaka
  0 siblings, 2 replies; 4+ messages in thread
From: Archie Pusaka @ 2021-05-19  8:21 UTC (permalink / raw)
  To: linux-bluetooth, Luiz Augusto von Dentz
  Cc: CrosBT Upstreaming, Archie Pusaka, Yun-Hao Chung

From: Archie Pusaka <apusaka@chromium.org>

Use strtoul to prevent 32 bit overflow

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

 lib/uuid.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/uuid.c b/lib/uuid.c
index a09321dc6e..3d97dc8359 100644
--- a/lib/uuid.c
+++ b/lib/uuid.c
@@ -209,7 +209,7 @@ static int bt_string_to_uuid32(bt_uuid_t *uuid, const char *string)
 	uint32_t u32;
 	char *endptr = NULL;
 
-	u32 = strtol(string, &endptr, 16);
+	u32 = strtoul(string, &endptr, 16);
 	if (endptr && *endptr == '\0') {
 		bt_uuid32_create(uuid, u32);
 		return 0;
-- 
2.31.1.751.gd2f1c929bd-goog


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

end of thread, other threads:[~2021-05-24 20:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-05-19  8:21 [Bluez PATCH] lib/uuid: Fix string to uuid32 conversion Archie Pusaka
2021-05-19  8:45 ` [Bluez] " bluez.test.bot
2021-05-23 16:24 ` [Bluez PATCH] " Archie Pusaka
2021-05-24 20:18   ` Luiz Augusto von Dentz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).