mirror of
https://github.com/github/codeql.git
synced 2025-12-21 19:26:31 +01:00
Apply suggestions from code review
Co-authored-by: Anders Schack-Mulligen <aschackmull@users.noreply.github.com>
This commit is contained in:
@@ -71,11 +71,12 @@ private class DefaultIntentRedirectionSink extends IntentRedirectionSink {
|
|||||||
*/
|
*/
|
||||||
private class DefaultIntentRedirectionSanitizer extends IntentRedirectionSanitizer {
|
private class DefaultIntentRedirectionSanitizer extends IntentRedirectionSanitizer {
|
||||||
DefaultIntentRedirectionSanitizer() {
|
DefaultIntentRedirectionSanitizer() {
|
||||||
exists(MethodAccess ma, Method m |
|
exists(MethodAccess ma, Method m, Guard g, boolean branch |
|
||||||
ma.getMethod() = m and
|
ma.getMethod() = m and
|
||||||
m.getDeclaringType() instanceof TypeComponentName and
|
m.getDeclaringType() instanceof TypeComponentName and
|
||||||
m.hasName(["getPackageName", "getClassName"]) and
|
m.hasName(["getPackageName", "getClassName"]) and
|
||||||
ma.getBasicBlock().(ConditionBlock).controls(this.asExpr().getBasicBlock(), true)
|
g.isEquality(ma, _, branch) and
|
||||||
|
g.controls(this.asExpr().getBasicBlock(), branch)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,6 @@ if (destinationComponent.getPackageName().equals("safe.package") &&
|
|||||||
// GOOD: The component that sent the Intent is checked before launching the destination component
|
// GOOD: The component that sent the Intent is checked before launching the destination component
|
||||||
Intent forwardIntent = (Intent) getIntent().getParcelableExtra("forward_intent");
|
Intent forwardIntent = (Intent) getIntent().getParcelableExtra("forward_intent");
|
||||||
ComponentName originComponent = getCallingActivity();
|
ComponentName originComponent = getCallingActivity();
|
||||||
if (originComponent.getPackageName().equals("trusted.package") && originComponent.getClassName("TrustedClass")) {
|
if (originComponent.getPackageName().equals("trusted.package") && originComponent.getClassName().equals("TrustedClass")) {
|
||||||
startActivity(forwardIntent);
|
startActivity(forwardIntent);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user