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

Commit 03189bb6 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: da3422f1 am: cc149f7f am: bfae1bfa am: 48079454
am: 0244b8e7

Change-Id: I27de4392027fd806aceee926b820f367ce9adefa
parents c517d039 0244b8e7
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));