Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a68e964e authored by Sravan voleti's avatar Sravan voleti Committed by Jakub Pawlowski
Browse files

Bluetooth: Prevent BT crash using adb commands

Use case:
Run below commands
1) adb shell am broadcast -n
    com.android.bluetooth/com.android.bluetooth.opp.BluetoothOppReceiver
2) adb shell am broadcast -n
    com.android.bluetooth/com.android.bluetooth.opp.BluetoothOppHandoverReceiver

Failure:
"Unfortunately, Bluetooth share has stopped" error comes.

Fix:
Add null check while processing with intent to fix Low severity
vulnerability in Bluetooth: Denial of Service.

Fixes: 130785642
Test: Performed sanity with above mentioned use case.
Change-Id: I0aadd14ba7f61d1b738f0a74d444e96ab82f86f1
parent 67f4acb1
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -32,7 +32,8 @@ public class BluetoothOppHandoverReceiver extends BroadcastReceiver {
    @Override
    public void onReceive(Context context, Intent intent) {
        String action = intent.getAction();

        if (D) Log.d(TAG, "Action :" + action);
        if (action == null) return;
        if (action.equals(Constants.ACTION_HANDOVER_SEND) || action.equals(
                Constants.ACTION_HANDOVER_SEND_MULTIPLE)) {
            final BluetoothDevice device =
+2 −1
Original line number Diff line number Diff line
@@ -58,7 +58,8 @@ public class BluetoothOppReceiver extends BroadcastReceiver {
    @Override
    public void onReceive(Context context, Intent intent) {
        String action = intent.getAction();

        if (D) Log.d(TAG, " action :" + action);
        if (action == null) return;
        if (action.equals(BluetoothDevicePicker.ACTION_DEVICE_SELECTED)) {
            BluetoothOppManager mOppManager = BluetoothOppManager.getInstance(context);