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

Commit 8a4f4b84 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "hearing_aid: Potential OOB in reading the PSM handle" into main am: 62e915d5

parents 521a7895 62e915d5
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -1041,12 +1041,14 @@ class HearingAidImpl : public HearingAid {
      return;
    }

    if (len > 2) {
    if (len < 2) {
      log::error("Bad PSM Lengh");
      return;
    }

    uint16_t psm = *((uint16_t*)value);
    uint16_t psm = 0;
    STREAM_TO_UINT16(psm, value);

    log::debug("read psm:0x{:x}", psm);

    if (hearingDevice->gap_handle == GAP_INVALID_HANDLE &&