[Bluez PATCH] lib/uuid: Fix string to uuid32 conversion

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Archie Pusaka <apusaka@xxxxxxxxxxxx>

Use strtoul to prevent 32 bit overflow

Reviewed-by: Yun-Hao Chung <howardchung@xxxxxxxxxxxx>
---

 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




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux