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

Commit ac0783d8 authored by Android Build Merger (Role)'s avatar Android Build Merger (Role)
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

Change-Id: Ib49b6f4a3b8f63f2c954385b57c8fa2ffcce372a
parents 6e09539f 79a820b8
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -1709,6 +1709,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);
    }
@@ -1720,6 +1725,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));