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

Commit f809cb86 authored by Jakub Rotkiewicz's avatar Jakub Rotkiewicz
Browse files

BQR: Log error instead of crash if event too short

When the Bluetooth Quality Report Event came too short the process
crashed. As per current implementation there is a possibility
that a BQR event is shorter, because not all controllers' vendors
extended the BQR event. A temporary solution is to only print
the error and return.

Bug: 293849013
Test: m libbtif-core
Test: manual - check BQR event logs
Change-Id: Iab7ec1f83135ddf8d517bbe919d3c9df1648885a
parent ad251cda
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -54,7 +54,7 @@ std::unique_ptr<BluetoothQualityReportInterface> bluetoothQualityReportInstance;
void BqrVseSubEvt::ParseBqrLinkQualityEvt(uint8_t length,
                                          const uint8_t* p_param_buf) {
  if (length < kLinkQualityParamTotalLen) {
    LOG(FATAL) << __func__
    LOG(ERROR) << __func__
               << ": Parameter total length: " << std::to_string(length)
               << " is abnormal. It shall be not shorter than: "
               << std::to_string(kLinkQualityParamTotalLen);
@@ -505,7 +505,7 @@ void CategorizeBqrEvent(uint8_t length, const uint8_t* p_bqr_event) {
    case QUALITY_REPORT_ID_LE_AUDIO_CHOPPY:
    case QUALITY_REPORT_ID_CONNECT_FAIL:
      if (length < kLinkQualityParamTotalLen) {
        LOG(FATAL) << __func__
        LOG(ERROR) << __func__
                   << ": Parameter total length: " << std::to_string(length)
                   << " is abnormal. It shall be not shorter than: "
                   << std::to_string(kLinkQualityParamTotalLen);