From e616cdea07bcee961d9c2e4b4720836d55d094c5 Mon Sep 17 00:00:00 2001 From: Josh Ferrell Date: Mon, 27 Apr 2026 12:21:35 -0400 Subject: [Mach-O] Fix crash reading malformed CFString --- objectivec/objc.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'objectivec/objc.cpp') diff --git a/objectivec/objc.cpp b/objectivec/objc.cpp index fb5187ee..3b6a9165 100644 --- a/objectivec/objc.cpp +++ b/objectivec/objc.cpp @@ -1687,7 +1687,7 @@ void ObjCProcessor::ProcessCFStrings() auto data = m_data->ReadBuffer(strLoc, size * 2); str = ""; - for (uint64_t bufferOff = 0; bufferOff < size * 2; bufferOff += 2) + for (uint64_t bufferOff = 0; bufferOff + 1 < data.GetLength(); bufferOff += 2) { uint8_t* rawData = static_cast(data.GetData()); uint8_t* offsetAddress = rawData + bufferOff; @@ -1779,7 +1779,7 @@ void ObjCProcessor::ProcessNSConstantArrays() } ScopedSymbolQueue::Get().Process(); } - + } void ObjCProcessor::ProcessNSConstantDictionaries() -- cgit v1.3.1