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

Commit a65d3a4b 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
am: 71056e2c

Change-Id: I27de4392027fd806aceee926b820f367ce9adefa
parents edd66071 71056e2c
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -1727,6 +1727,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);
    }
@@ -1738,6 +1743,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));