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 {
87
87
AndroidBundle ( ) { this .getASupertype * ( ) .hasQualifiedName ( "android.os" , "BaseBundle" ) }
88
88
}
89
89
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
+ */
91
101
class ExplicitIntent extends Expr {
92
102
ExplicitIntent ( ) {
93
103
exists ( MethodAccess ma , Method m |
Original file line number Diff line number Diff line change @@ -94,9 +94,10 @@ private class MutablePendingIntentFlowStep extends PendingIntentAsFieldAdditiona
94
94
node2 .asExpr ( ) = pic and
95
95
flagArg = pic .getFlagsArg ( )
96
96
|
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.
100
101
not TaintTracking:: localExprTaint ( any ( ImmutablePendingIntentFlag flag ) .getAnAccess ( ) , flagArg )
101
102
or
102
103
TaintTracking:: localExprTaint ( any ( MutablePendingIntentFlag flag ) .getAnAccess ( ) , flagArg )
You can’t perform that action at this time.
0 commit comments