Fix idmap calls when a subdir is present.
We need to increase the size of argv so that the last one remains
a NULL.
Bug: 32202741
Change-Id: I6636b5401fa7a61686a48c9a99b3e54e596033f9
diff --git a/core/jni/android_util_AssetManager.cpp b/core/jni/android_util_AssetManager.cpp
index 52b7ef4..7aab58c 100644
--- a/core/jni/android_util_AssetManager.cpp
+++ b/core/jni/android_util_AssetManager.cpp
@@ -175,7 +175,7 @@
}
// Generic idmap parameters
- const char* argv[7];
+ const char* argv[8];
int argc = 0;
struct stat st;
@@ -203,7 +203,7 @@
// Finally, invoke idmap (if any overlay directory exists)
if (argc > 5) {
execv(AssetManager::IDMAP_BIN, (char* const*)argv);
- ALOGE("failed to execl for idmap: %s", strerror(errno));
+ ALOGE("failed to execv for idmap: %s", strerror(errno));
exit(1); // should never get here
} else {
exit(0);