nativeloader: Ignore empty java_permitted_path
Passing empty permitted path should result in no-op.
This addresses review comment on CL with commit
f334cbf0e1425633bef96a21b0ce9e30f4c6ffa9
Bug: http://b/28639227
Change-Id: I4a4540e522e90a145a374939921932c86f35e88d
diff --git a/libnativeloader/native_loader.cpp b/libnativeloader/native_loader.cpp
index 0b49b41..8103b37 100644
--- a/libnativeloader/native_loader.cpp
+++ b/libnativeloader/native_loader.cpp
@@ -78,7 +78,9 @@
if (java_permitted_path != nullptr) {
ScopedUtfChars path(env, java_permitted_path);
- permitted_path = permitted_path + ":" + path.c_str();
+ if (path.c_str() != nullptr && path.size() > 0) {
+ permitted_path = permitted_path + ":" + path.c_str();
+ }
}
if (!initialized_ && !InitPublicNamespace(library_path.c_str(), target_sdk_version)) {