From 00c0cd4a24bd0f040055f9e786e2df1fa3b7d2d3 Mon Sep 17 00:00:00 2001 From: Jeff Brown Date: Wed, 10 Sep 2014 16:48:46 -0700 Subject: Clean entire arg block when setting process name. When Android processes fork from Zygote, we rewrite the command line with a new name, eg. "system_server". When we do this, we should fill the entire block with zeros to remove corrupted argument information that may otherwise remain in the /proc//cmdline buffer and be seen in tools and stack dumps. Fixed an issue where VM options could be overwritten after setting the nice name if the name was too long. Bug: 17474152 Change-Id: Ie6cf9ed7752a04300a340e26cd6812bb35c59e1b --- include/android_runtime/AndroidRuntime.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'include') diff --git a/include/android_runtime/AndroidRuntime.h b/include/android_runtime/AndroidRuntime.h index 51e47e6..f3cfd97 100644 --- a/include/android_runtime/AndroidRuntime.h +++ b/include/android_runtime/AndroidRuntime.h @@ -45,6 +45,7 @@ public: }; void setArgv0(const char* argv0); + void addOption(const char* optionString, void* extra_info = NULL); /** * Register a set of methods in the specified class. @@ -63,8 +64,6 @@ public: */ static jclass findClass(JNIEnv* env, const char* className); - int addVmArguments(int argc, const char* const argv[]); - void start(const char *classname, const Vector& options); void exit(int code); @@ -116,7 +115,6 @@ public: private: static int startReg(JNIEnv* env); - void addOption(const char* optionString, void* extra_info = NULL); bool parseRuntimeOption(const char* property, char* buffer, const char* runtimeArg, -- cgit v1.1