Skip to content

Commit 957a5e9

Browse files
committed
[lldb] Fix nullptr dereference in AppleObjCRuntimeV2
Fix a potential nullptr dereference in AppleObjCRuntimeV2 by checking the result of GetClassInfoUtilityFunction and returning a failure if it's null. The DynamicClassInfoExtractor was already doign the right thing, but the SharedCacheClassInfoExtractor was missing this check.
1 parent 8189c4e commit 957a5e9

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1995,6 +1995,11 @@ AppleObjCRuntimeV2::SharedCacheClassInfoExtractor::UpdateISAToDescriptorMap() {
19951995
const uint32_t num_classes = 128 * 1024;
19961996

19971997
UtilityFunction *get_class_info_code = GetClassInfoUtilityFunction(exe_ctx);
1998+
if (!get_class_info_code) {
1999+
// The callee will have already logged a useful error message.
2000+
return DescriptorMapUpdateResult::Fail();
2001+
}
2002+
19982003
FunctionCaller *get_shared_cache_class_info_function =
19992004
get_class_info_code->GetFunctionCaller();
20002005

0 commit comments

Comments
 (0)