Fix OOB of L2CAP_CMD_CREDIT_BASED_CONN_RES Change-Id: Ic947572e179ec4dacae9655192cadac7cf8c3ea4 TAG: #security Bug: 213519176 Test: manual Ignore-AOSP-First: security fix (cherry picked from commit ed4b512d2b3d45151b7f70e4c8c60b1a052a5d7c) Merged-In: Ic947572e179ec4dacae9655192cadac7cf8c3ea4
diff --git a/stack/l2cap/l2c_ble.cc b/stack/l2cap/l2c_ble.cc index 16454a5..d548679 100644 --- a/stack/l2cap/l2c_ble.cc +++ b/stack/l2cap/l2c_ble.cc
@@ -621,7 +621,7 @@ break; } case L2CAP_CMD_CREDIT_BASED_CONN_RES: - if (p + 2 > p_pkt_end) { + if (p + 8 > p_pkt_end) { LOG(ERROR) << "invalid L2CAP_CMD_CREDIT_BASED_CONN_RES len"; return; }