From 5c5ddf9f6bfaf787fd0502766f519cd5dd51cc95 Mon Sep 17 00:00:00 2001 From: AZero13 Date: Thu, 11 Dec 2025 10:24:31 -0500 Subject: [PATCH] CFUUID: Check for lens first BEFORE hex char to avoid out of bounds read --- Sources/CoreFoundation/CFUUID.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/CoreFoundation/CFUUID.c b/Sources/CoreFoundation/CFUUID.c index beb0911eb7..4a39e5560f 100644 --- a/Sources/CoreFoundation/CFUUID.c +++ b/Sources/CoreFoundation/CFUUID.c @@ -258,7 +258,7 @@ CFUUIDRef CFUUIDCreateFromString(CFAllocatorRef alloc, CFStringRef uuidStr) { memset((void *)&bytes, 0, sizeof(bytes)); /* Skip initial random stuff */ - while (!_isHexChar(chars[i]) && i < len) i++; + while (i < len && !_isHexChar(chars[i])) i++; READ_A_BYTE(bytes.byte0); READ_A_BYTE(bytes.byte1);