-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
Hello. I have a question about native_method_overloading task.
Lines 14 to 17 in b92ad62
| * @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.
Lines 40 to 47 in b92ad62
| 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)
NativeFlowBench/native_method_overloading/src/main/jni/method_overloading.cpp
Lines 38 to 45 in b92ad62
| 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?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels