@@ -34,18 +34,19 @@ class AndroidFileLeakConfig extends TaintTracking::Configuration {
34
34
/**
35
35
* Holds if `src` is a read of some Intent-typed method argument guarded by a check like
36
36
* `requestCode == REQUEST_CODE__SELECT_CONTENT_FROM_APPS`, where `requestCode` is the first
37
- * argument to `Activity.onActivityResult`.
37
+ * argument to `Activity.onActivityResult` and `REQUEST_CODE__SELECT_CONTENT_FROM_APPS` is
38
+ * any request code in a call to `startActivityForResult(intent, code)`.
38
39
*/
39
40
override predicate isSource ( DataFlow:: Node src ) {
40
41
exists (
41
- AndroidActivityResultInput ai , AndroidFileIntentInput fi , ConditionBlock cb ,
42
- VarAccess intentVar
42
+ AndroidActivityResultInput ai , AndroidFileIntentInput fi , ConditionBlock cb , EQExpr ee ,
43
+ CompileTimeConstantExpr cc , VarAccess intentVar
43
44
|
44
- cb .getCondition ( ) . getAChildExpr ( ) . ( CompileTimeConstantExpr ) . getIntValue ( ) =
45
- fi . getRequestCode ( ) and
46
- cb . getCondition ( ) . getAChildExpr ( ) = ai . getRequestCodeVar ( ) and
45
+ cb .getCondition ( ) = ee and
46
+ ee . hasOperands ( ai . getRequestCodeVar ( ) , cc ) and
47
+ cc . getIntValue ( ) = fi . getRequestCode ( ) and
47
48
intentVar .getType ( ) instanceof TypeIntent and
48
- cb .getBasicBlock ( ) = intentVar .( Argument ) . getAnEnclosingStmt ( ) and
49
+ cb .controls ( intentVar .getBasicBlock ( ) , true ) and
49
50
src .asExpr ( ) = intentVar
50
51
)
51
52
}
0 commit comments