From: Po Lu Date: Mon, 16 Oct 2023 01:00:45 +0000 (+0800) Subject: Properly initialize argment list supplied to android_init_emacs X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=36656ff70e3d8971117b0d25b2afd2727b09b098;p=emacs.git Properly initialize argment list supplied to android_init_emacs * src/android.c (initEmacs): NULL-terminate c_argv. --- diff --git a/src/android.c b/src/android.c index 8c4748cccf6..9f0e966a602 100644 --- a/src/android.c +++ b/src/android.c @@ -1826,7 +1826,7 @@ NATIVE_NAME (initEmacs) (JNIEnv *env, jobject object, jarray argv, android_java_env = env; nelements = (*env)->GetArrayLength (env, argv); - c_argv = alloca (sizeof *c_argv * nelements); + c_argv = alloca (sizeof *c_argv * (nelements + 1)); for (i = 0; i < nelements; ++i) { @@ -1844,6 +1844,8 @@ NATIVE_NAME (initEmacs) (JNIEnv *env, jobject object, jarray argv, (*env)->ReleaseStringUTFChars (env, (jstring) argument, c_argument); } + c_argv[nelements] = NULL; + android_init_emacs_service (); android_init_emacs_pixmap (); android_init_graphics_point ();