Skip to content

Specific Method between source and sink matters in detecting leak? #193

Open
@whavey

Description

@whavey

With sendTextMessage defined as a sink and getIpAddress defined as a source flowdroid reports a leak when converting the IP address to a string using Integer.toString but not when using android.text.format.Formatter even though the source data flows through the same way. Does the specific method matter between a source and a sink when source data is flowing through the same way?

Jimple when using formatter (no leak reported):

$r5 = staticinvoke <android.telephony.SmsManager: android.telephony.SmsManager getDefault()>();
$r6 = virtualinvoke $r4.<android.net.wifi.WifiManager: android.net.wifi.WifiInfo getConnectionInfo()>();
$i0 = virtualinvoke $r6.<android.net.wifi.WifiInfo: int getIpAddress()>();
$r7 = staticinvoke <android.text.format.Formatter: java.lang.String formatIpAddress(int)>($i0);
virtualinvoke $r5.<android.telephony.SmsManager: void sendTextMessage(java.lang.String,java.lang.String,java.lang.String,android.app.PendingIntent,android.app.PendingIntent)    >("8885551234", null, $r7, null, null);

Jimple when using toString (leak reported):

$r5 = virtualinvoke $r4.<android.net.wifi.WifiManager: android.net.wifi.WifiInfo getConnectionInfo()>();
$i0 = virtualinvoke $r5.<android.net.wifi.WifiInfo: int getIpAddress()>();
$r6 = staticinvoke <java.lang.Integer: java.lang.String toString(int)>($i0);
$r7 = staticinvoke <android.telephony.SmsManager: android.telephony.SmsManager getDefault()>();
virtualinvoke $r7.<android.telephony.SmsManager: void sendTextMessage(java.lang.String,java.lang.String,java.lang.String,android.app.PendingIntent,android.app.PendingIntent)>("8885551234", null, $r6, null, null);

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions