From 9893c4773ce1da4dfb9f15140e93bf785abd89f7 Mon Sep 17 00:00:00 2001 From: Nicolas Geoffray Date: Tue, 13 Nov 2018 15:39:53 +0000 Subject: Add missed null check in ClassLoaderContext::VerifyClassLoaderContextMatch. bug: 119441748 Test: class_loader_context_test Change-Id: I68301a568eb321b42209584a3328e9a1b0fcc7ba --- runtime/class_loader_context.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'runtime/class_loader_context.cc') diff --git a/runtime/class_loader_context.cc b/runtime/class_loader_context.cc index de9fe221ff..0bae60a886 100644 --- a/runtime/class_loader_context.cc +++ b/runtime/class_loader_context.cc @@ -338,6 +338,7 @@ bool ClassLoaderContext::OpenDexFiles(InstructionSet isa, const std::string& cla // no dex files. So that we can distinguish the real failures... const ArtDexFileLoader dex_file_loader; std::vector work_list; + CHECK(class_loader_chain_ != nullptr); work_list.push_back(class_loader_chain_.get()); while (!work_list.empty()) { ClassLoaderInfo* info = work_list.back(); @@ -908,7 +909,9 @@ ClassLoaderContext::VerificationResult ClassLoaderContext::VerifyClassLoaderCont // collision check. if (expected_context.special_shared_library_) { // Special case where we are the only entry in the class path. - if (class_loader_chain_->parent == nullptr && class_loader_chain_->classpath.size() == 0) { + if (class_loader_chain_ != nullptr && + class_loader_chain_->parent == nullptr && + class_loader_chain_->classpath.size() == 0) { return VerificationResult::kVerifies; } return VerificationResult::kForcedToSkipChecks; -- cgit v1.2.3-59-g8ed1b