mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
Java: Reveal false negative in test
One of the sinks was flagged for the wrong reason in the test case. The flow into the 'startActivities' sink isn't working properly, but this was not revealed by the test since an alternate, spurious path exists. The spurious path goes through the implicit read at the prior sink and takes a use-use step to the 'startActivities' sink. Swapping the order of the two sinks reveals the false negative.
This commit is contained in:
@@ -1,2 +1,3 @@
|
||||
failures
|
||||
testFailures
|
||||
| ImplicitPendingIntentsTest.java:35:60:35:87 | // $hasImplicitPendingIntent | Missing result:hasImplicitPendingIntent= |
|
||||
|
||||
@@ -32,8 +32,8 @@ public class ImplicitPendingIntentsTest {
|
||||
PendingIntent pi = PendingIntent.getActivity(ctx, 0, baseIntent, 0);
|
||||
Intent fwdIntent = new Intent();
|
||||
fwdIntent.putExtra("fwdIntent", pi);
|
||||
ctx.startActivity(fwdIntent); // $hasImplicitPendingIntent
|
||||
ctx.startActivities(new Intent[] {fwdIntent}); // $hasImplicitPendingIntent
|
||||
ctx.startActivity(fwdIntent); // $hasImplicitPendingIntent
|
||||
ctx.startService(fwdIntent); // Safe
|
||||
ctx.sendBroadcast(fwdIntent); // $hasImplicitPendingIntent
|
||||
|
||||
|
||||
Reference in New Issue
Block a user