From 25df4bff44a0d1a342dc45521bf7e860b3fef947 Mon Sep 17 00:00:00 2001 From: Dimitry Ivanov Date: Mon, 16 May 2016 17:08:06 -0700 Subject: [PATCH] Pass permitted_path to the linker as is. Now that we have the fixed list of whitelisted libraries there is no longer need to check if java_permitted_path is nullptr. In fact checking it prevents custom classloaders created by apps from loading libraries using absolute path. Bug: http://b/28659864 Change-Id: I1bfc16a573b090f70f078ecccd0e4016939a5dc0 (cherry picked from commit b31caa95ec1ab9da7b300544e9716c1cac92d8f8) --- libnativeloader/native_loader.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libnativeloader/native_loader.cpp b/libnativeloader/native_loader.cpp index 488608af0..44f17cd99 100644 --- a/libnativeloader/native_loader.cpp +++ b/libnativeloader/native_loader.cpp @@ -101,9 +101,7 @@ class LibraryNamespaces { nullptr, library_path.c_str(), namespace_type, - !permitted_path.empty() ? - permitted_path.c_str() : - nullptr); + permitted_path.c_str()); if (ns != nullptr) { namespaces_.push_back(std::make_pair(env->NewWeakGlobalRef(class_loader), ns));