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

Commit 9346908a authored by Cheney Ni's avatar Cheney Ni Committed by android-build-merger
Browse files

AdapterService: Check the PIN code length before using

am: 1feb4d24

Change-Id: I16c424e686d40209298252973146a02eaa182718
parents e045cc7c 1feb4d24
Loading
Loading
Loading
Loading
+12 −0
Original line number Original line Diff line number Diff line
@@ -2233,6 +2233,12 @@ public class AdapterService extends Service {
            return false;
            return false;
        }
        }


        if (pinCode.length != len) {
            android.util.EventLog.writeEvent(0x534e4554, "139287605", -1,
                    "PIN code length mismatch");
            return false;
        }

        StatsLog.write(StatsLog.BLUETOOTH_BOND_STATE_CHANGED,
        StatsLog.write(StatsLog.BLUETOOTH_BOND_STATE_CHANGED,
                obfuscateAddress(device), 0, device.getType(),
                obfuscateAddress(device), 0, device.getType(),
                BluetoothDevice.BOND_BONDING,
                BluetoothDevice.BOND_BONDING,
@@ -2249,6 +2255,12 @@ public class AdapterService extends Service {
            return false;
            return false;
        }
        }


        if (passkey.length != len) {
            android.util.EventLog.writeEvent(0x534e4554, "139287605", -1,
                    "Passkey length mismatch");
            return false;
        }

        StatsLog.write(StatsLog.BLUETOOTH_BOND_STATE_CHANGED,
        StatsLog.write(StatsLog.BLUETOOTH_BOND_STATE_CHANGED,
                obfuscateAddress(device), 0, device.getType(),
                obfuscateAddress(device), 0, device.getType(),
                BluetoothDevice.BOND_BONDING,
                BluetoothDevice.BOND_BONDING,