diff options
| author | Mason Reed <mason@vector35.com> | 2026-05-28 17:53:38 -0400 |
|---|---|---|
| committer | Mason Reed <mason@vector35.com> | 2026-05-28 17:53:38 -0400 |
| commit | 02e67da266d21e106d0b9900a2a98dbf8d045ad2 (patch) | |
| tree | 5662a2038919c7eadba439121afe1ea5c744cb64 | |
| parent | b24fcc83e829e3f367b88b507daf23e57bce66c2 (diff) | |
[Objective-C] Fix horrid bounds checking from previous fix
Fixes 912465b5cf1d0442443d9584e15111361f27751c regression that broke cfstring parsing
| -rw-r--r-- | objectivec/objc.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/objectivec/objc.cpp b/objectivec/objc.cpp index 1b53a366..72f07c9c 100644 --- a/objectivec/objc.cpp +++ b/objectivec/objc.cpp @@ -1693,9 +1693,9 @@ void ObjCProcessor::ProcessCFStrings() { reader->Seek(i + ptrSize); uint64_t flags = reader->ReadPointer(); - auto strLoc = ReadPointerAccountingForRelocations(reader.get()); - auto size = reader->ReadPointer(); - if (size > cfstrings->GetEnd() || reader->GetOffset() > cfstrings->GetEnd() - size) + const auto strLoc = ReadPointerAccountingForRelocations(reader.get()); + const auto size = reader->ReadPointer(); + if (!m_data->IsValidOffset(strLoc + size)) { m_logger->LogWarn("CFString at 0x%llx has invalid size 0x%llx, skipping...", i, size); continue; |
