File tree Expand file tree Collapse file tree 2 files changed +15
-4
lines changed
java/ql/lib/semmle/code/java Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -87,7 +87,17 @@ class AndroidBundle extends Class {
8787 AndroidBundle ( ) { this .getASupertype * ( ) .hasQualifiedName ( "android.os" , "BaseBundle" ) }
8888}
8989
90- /** An `Intent` that explicitly sets a destination component. */
90+ /**
91+ * An `Intent` that explicitly sets a destination component.
92+ *
93+ * The `Intent` is not considered explicit if a `null` value ever flows to the destination
94+ * component, even if only conditionally.
95+ *
96+ * For example, in the following code, `intent` is not considered an `ExplicitIntent`:
97+ * ```java
98+ * intent.setClass(condition ? null : "MyClass");
99+ * ```
100+ */
91101class ExplicitIntent extends Expr {
92102 ExplicitIntent ( ) {
93103 exists ( MethodAccess ma , Method m |
Original file line number Diff line number Diff line change @@ -94,9 +94,10 @@ private class MutablePendingIntentFlowStep extends PendingIntentAsFieldAdditiona
9494 node2 .asExpr ( ) = pic and
9595 flagArg = pic .getFlagsArg ( )
9696 |
97- // We err on the side of false positives here, assuming a PendingIntent may be mutable unless it is at
98- // least sometimes explicitly marked immutable and never marked mutable.
99- // Note for API level < 31, PendingIntents were mutable by default, whereas since then they are immutable by default.
97+ // We err on the side of false positives here, assuming a PendingIntent may be mutable
98+ // unless it is at least sometimes explicitly marked immutable and never marked mutable.
99+ // Note: for API level < 31, PendingIntents were mutable by default, whereas since then
100+ // they are immutable by default.
100101 not TaintTracking:: localExprTaint ( any ( ImmutablePendingIntentFlag flag ) .getAnAccess ( ) , flagArg )
101102 or
102103 TaintTracking:: localExprTaint ( any ( MutablePendingIntentFlag flag ) .getAnAccess ( ) , flagArg )
You can’t perform that action at this time.
0 commit comments