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

Commit 67997605 authored by liuchao's avatar liuchao Committed by Myles Watson
Browse files

Fix out-of-bound array access in jv handle err log

Since the port_handle is checked invalid in bta_jv_rfc_port_to_cb
the error print of bta_jv_cb.port_cb[port_handle - 1].handle is
inappropriate

Test: mm -j8
Change-Id: I0562706512bb993d9a65676d11274d21fa9e70ef
parent 53b174e7
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -242,10 +242,8 @@ tBTA_JV_RFC_CB* bta_jv_rfc_port_to_cb(uint16_t port_handle) {
    handle &= ~BTA_JV_RFCOMM_MASK;
    if (handle) p_cb = &bta_jv_cb.rfc_cb[handle - 1];
  } else {
    APPL_TRACE_WARNING(
        "bta_jv_rfc_port_to_cb(port_handle:0x%x):jv handle:0x%x not"
        " FOUND",
        port_handle, bta_jv_cb.port_cb[port_handle - 1].handle);
    APPL_TRACE_WARNING("%s (port_handle:0x%x):jv handle not found", __func__,
                       port_handle);
  }
  return p_cb;
}