From: Heinrich Schuchardt Date: Sun, 3 Nov 2024 22:42:22 +0000 (+0100) Subject: lib: uuid: fix uuid_str_to_bin() on 32-bit X-Git-Url: http://git.dujemihanovic.xyz/img/static/%7B%7B%20%28.OutputFormats.Get?a=commitdiff_plain;h=6a2664b126bc6acccac45f7c2864df36d0624728;p=u-boot.git lib: uuid: fix uuid_str_to_bin() on 32-bit hextoul() cannot convert a string to a 64-bit number on a 32-bit system. Use function hextoull() instead. Reported-by: Patrick Delaunay Fixes: 22c48a92cdce ("lib: uuid: supporting building as part of host tools") Signed-off-by: Heinrich Schuchardt Reviewed-by: Caleb Connolly Reviewed-by: Ilias Apalodimas Tested-by: Patrick Delaunay Reviewed-by: Patrick Delaunay --- diff --git a/lib/uuid.c b/lib/uuid.c index 19f33dd147..538a1ba6aa 100644 --- a/lib/uuid.c +++ b/lib/uuid.c @@ -313,7 +313,7 @@ int uuid_str_to_bin(const char *uuid_str, unsigned char *uuid_bin, tmp16 = cpu_to_be16(hextoul(uuid_str + 19, NULL)); memcpy(uuid_bin + 8, &tmp16, 2); - tmp64 = cpu_to_be64(hextoul(uuid_str + 24, NULL)); + tmp64 = cpu_to_be64(hextoull(uuid_str + 24, NULL)); memcpy(uuid_bin + 10, (char *)&tmp64 + 2, 6); return 0;