Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect TAINTSINK Output for Sink Placement #1

Closed
LordAmit opened this issue Sep 4, 2019 · 0 comments
Closed

Incorrect TAINTSINK Output for Sink Placement #1

LordAmit opened this issue Sep 4, 2019 · 0 comments

Comments

@LordAmit
Copy link
Owner

LordAmit commented Sep 4, 2019

Consider the following code:

package edu.wm.cs.semeru.exampleapp;

import android.content.Context;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.telephony.PhoneStateListener;
import android.telephony.TelephonyManager;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        TelephonyManager manager = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
        manager.listen(new PhoneStateListener() {
            @Override
            public void onDataConnectionStateChanged(int state) {

            }
        }, PhoneStateListener.LISTEN_NONE);
    }
}

The current output is

package edu.wm.cs.semeru.exampleapp;

import android.content.Context;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.telephony.PhoneStateListener;
import android.telephony.TelephonyManager;

public class MainActivity extends AppCompatActivity {

    String dataLeAk2 = "2";

	String dataLeAk0 = "0";

	@Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
		android.util.Log.d("leak-0-0", dataLeAk0);
		android.util.Log.d("leak-2-0", dataLeAk2);
		dataLeAk0 = java.util.Calendar.getInstance().getTimeZone().getDisplayName();
        setContentView(R.layout.activity_main);

        TelephonyManager manager = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
        manager.listen(new PhoneStateListener() {
            String dataLeAk1 = "1";

			@Override
            public void onDataConnectionStateChanged(int state) {
				dataLeAk2 = java.util.Calendar.getInstance().getTimeZone().getDisplayName();
				dataLeAk1 = java.util.Calendar.getInstance().getTimeZone().getDisplayName();

            }
        }, PhoneStateListener.LISTEN_NONE);
    }
}

There is no sink for dataLeAk1. Should have one inside the onDataConnetionStateChanged() method.

@LordAmit LordAmit closed this as completed Apr 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant