Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 92b231f0 authored by Ajay Panicker's avatar Ajay Panicker
Browse files

dumpNative has garbage in args

|args| sometimes has garbage in it which can cause segfaults later on.

Change-Id: Ie754d8066dc591b4d64e922b1ffe93fe131bc68d
parent 6d5ae675
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -1177,7 +1177,9 @@ static void dumpNative(JNIEnv *env, jobject obj, jobject fdObj,
    int numArgs = env->GetArrayLength(argArray);

    jstring *argObjs = new jstring[numArgs];
    const char **args = new const char*[numArgs];
    const char **args = nullptr;
    if (numArgs > 0)
      args = new const char*[numArgs];

    for (int i = 0; i < numArgs; i++) {
      argObjs[i] = (jstring) env->GetObjectArrayElement(argArray, i);