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

Commit 8ad3ce86 authored by Pavlin Radoslavov's avatar Pavlin Radoslavov Committed by android-build-merger
Browse files

Merge "Add packet length check for received AVCTP packets" into oc-dev am:...

Merge "Add packet length check for received AVCTP packets" into oc-dev am: 9f141a72 am: 3751783b am: 340832fd
am: 7bee45ec

Change-Id: I7b08c6eef3a9f609f24b7efb5cee9488183f6181
parents 4d786686 7bee45ec
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@
 *
 *****************************************************************************/

#include <log/log.h>
#include <string.h>
#include "avct_api.h"
#include "avct_int.h"
@@ -520,6 +521,14 @@ void avct_bcb_msg_ind(tAVCT_BCB* p_bcb, tAVCT_LCB_EVT* p_data) {
    return;
  }

  if (p_data->p_buf->len < AVCT_HDR_LEN_SINGLE) {
    AVCT_TRACE_WARNING("Invalid AVCTP packet length %d: must be at least %d",
                       p_data->p_buf->len, AVCT_HDR_LEN_SINGLE);
    osi_free_and_reset((void**)&p_data->p_buf);
    android_errorWriteLog(0x534e4554, "79944113");
    return;
  }

  p = (uint8_t*)(p_data->p_buf + 1) + p_data->p_buf->offset;

  /* parse header byte */