Skip to content
Snippets Groups Projects
Commit cf9892b6 authored by Dimitry Ivanov's avatar Dimitry Ivanov
Browse files

nativeloader: Fix the case of search_path == null

When user creates custom classloader which does not extend
BaseDexClassLoader the librarySearchPath gets set to null
by java.lang.Runtime.doLoad().

This patch makes nativeloader correctly handle it.

Bug: http://b/28659864
Change-Id: I1b61c6bc952984d7c49775a9178fc3270948e62a
(cherry picked from commit 8a0425b8)
parent 08660a81
Branches
Tags
No related merge requests found
...@@ -56,7 +56,12 @@ class LibraryNamespaces { ...@@ -56,7 +56,12 @@ class LibraryNamespaces {
jstring java_library_path, jstring java_library_path,
jstring java_permitted_path, jstring java_permitted_path,
int32_t target_sdk_version) { int32_t target_sdk_version) {
ScopedUtfChars library_path(env, java_library_path); std::string library_path; // empty string by default.
if (java_library_path != nullptr) {
ScopedUtfChars library_path_utf_chars(env, java_library_path);
library_path = library_path_utf_chars.c_str();
}
std::string permitted_path; std::string permitted_path;
if (java_permitted_path != nullptr) { if (java_permitted_path != nullptr) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment