From 519477fbc78b1a29d752c26e7933dfe16e80d360 Mon Sep 17 00:00:00 2001 From: kat Date: Mon, 4 Nov 2024 10:22:23 -0500 Subject: [SharedCache] Barebones sanity check on ivar list size --- view/sharedcache/core/ObjC.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'view/sharedcache/core/ObjC.cpp') diff --git a/view/sharedcache/core/ObjC.cpp b/view/sharedcache/core/ObjC.cpp index 265506c2..271e5c94 100644 --- a/view/sharedcache/core/ObjC.cpp +++ b/view/sharedcache/core/ObjC.cpp @@ -889,6 +889,11 @@ void DSCObjCProcessor::ReadIvarList(VMReader* reader, ClassBase& cls, std::strin head.count = reader->Read32(); auto addressSize = m_data->GetAddressSize(); DefineObjCSymbol(DataSymbol, m_typeNames.ivarList, "ivar_list_" + name, start, true); + if (head.count > 0x1000) + { + m_logger->LogError("Ivar list at 0x%llx has an invalid count of 0x%llx", start, head.count); + return; + } for (unsigned i = 0; i < head.count; i++) { try -- cgit v1.3.1