Skip to content

native_method_overloading task seems to leak data #2

@j31d0

Description

@j31d0

Hello. I have a question about native_method_overloading task.

* @description The value v of a source is sent to an overloaded native function f2.
* f2 is not leaking the data.
* @dataflow
* @number_of_leaks 0

These comments asserts there is no leak in this task.

private void leakImei() {
TelephonyManager tel = (TelephonyManager) getSystemService(TELEPHONY_SERVICE);
if (checkSelfPermission(Manifest.permission.READ_PHONE_STATE) != PackageManager.PERMISSION_GRANTED) {
return;
}
String imei = tel.getDeviceId(); // source
send(new int[1], new String[1], imei, 0D);
}

And in leakImei(), it calls send method with 4 arguments (corresponds to signature native void send(int[] array, String[] array2, String data, double d)

JNIEXPORT void JNICALL
Java_org_arguslab_native_1method_1overloading_MainActivity_send___3I_3Ljava_lang_String_2Ljava_lang_String_2D(
JNIEnv *env, jobject thisObj, jintArray array, jobjectArray array2, jstring data,
jdouble d) {
LOGI("%s", getCharFromString(env, data)); // leak
return;
}

But in JNI code, it clearly leaks the data (as comment). Does it actually leaks data? or it's just my misunderstanding?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions