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

Commit 71056e2c authored by Cheney Ni's avatar Cheney Ni Committed by android-build-merger
Browse files

[automerger] AdapterService: Check the PIN code length before using am:...

[automerger] AdapterService: Check the PIN code length before using am: 49d81fa7 am: cf44ae92 am: 79a820b8
am: ac0783d8

Change-Id: Ie861994a1cd1d67aa97ed9c189c710d1e5d23cc3
parents 7d859a85 ac0783d8
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -1725,6 +1725,11 @@ public class AdapterService extends Service {
            return false;
        }

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

        byte[] addr = Utils.getBytesFromAddress(device.getAddress());
        return pinReplyNative(addr, accept, len, pinCode);
    }
@@ -1736,6 +1741,11 @@ public class AdapterService extends Service {
            return false;
        }

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

        byte[] addr = Utils.getBytesFromAddress(device.getAddress());
        return sspReplyNative(addr, AbstractionLayer.BT_SSP_VARIANT_PASSKEY_ENTRY, accept,
                Utils.byteArrayToInt(passkey));