diff options
author | Dimitry Ivanov <dimitry@google.com> | 2016-05-09 19:17:10 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2016-05-09 19:17:10 +0000 |
commit | 179fea40bb1ed2da183f3a2a6398d1c68b9f6f32 (patch) | |
tree | d7d92f136687cf30e93c2e3c240df9eeb0e0d400 /libnativeloader/native_loader.cpp | |
parent | fc2a8b2bd605e4639db0feaab49c516c0ae90180 (diff) | |
parent | 8a0425b86acd4f20ef68ef350ac32e1c5057c558 (diff) |
Merge "nativeloader: Fix the case of search_path == null"
Diffstat (limited to 'libnativeloader/native_loader.cpp')
-rw-r--r-- | libnativeloader/native_loader.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libnativeloader/native_loader.cpp b/libnativeloader/native_loader.cpp index 7f21375bd..33d5b62a4 100644 --- a/libnativeloader/native_loader.cpp +++ b/libnativeloader/native_loader.cpp @@ -54,7 +54,12 @@ class LibraryNamespaces { bool is_shared, jstring java_library_path, jstring java_permitted_path) { - 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; if (java_permitted_path != nullptr) { |