Skip to content

Commit

Permalink
Made sure incoming intent isnt null before we see if its from the sys…
Browse files Browse the repository at this point in the history
…tem #1041

Not sure why'd you get a null intent anyway, but this way we avoid a NPE...
  • Loading branch information
bitmold committed Dec 18, 2023
1 parent b5a5c71 commit 8a9f979
Showing 1 changed file with 11 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,15 @@ else if (mCurrentStatus.equals(STATUS_ON)) {
}

public int onStartCommand(Intent intent, int flags, int startId) {
final boolean shouldStartVpnFromSystemIntent =
!intent.getBooleanExtra(OrbotConstants.EXTRA_NOT_SYSTEM, false);
try {
if (intent == null) {
Log.d(TAG, "Got null onStartCommand() intent");
return Service.START_REDELIVER_INTENT;
}

final boolean shouldStartVpnFromSystemIntent =
!intent.getBooleanExtra(OrbotConstants.EXTRA_NOT_SYSTEM, false);

if (mCurrentStatus.equals(STATUS_OFF))
showToolbarNotification(getString(R.string.open_orbot_to_connect_to_tor), NOTIFY_ID, R.drawable.ic_stat_tor);

Expand All @@ -254,18 +260,14 @@ public int onStartCommand(Intent intent, int flags, int startId) {
+ "which should be impossible!");
}
}
else if (intent != null)
else {
mExecutor.execute(new IncomingIntentRouter(intent));
else
Log.d(TAG, "Got null onStartCommand() intent");

}
}
catch (RuntimeException re)
{
catch (RuntimeException re) {
//catch this to avoid malicious launches as document Cure53 Audit: ORB-01-009 WP1/2: Orbot DoS via exported activity (High)
}


return Service.START_REDELIVER_INTENT;
}

Expand Down

0 comments on commit 8a9f979

Please sign in to comment.