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

Commit be3ea93c authored by Ajay Panicker's avatar Ajay Panicker Committed by android-build-merger
Browse files

Merge "DO NOT MERGE: Check number of attributes before writing to a buffer" into oc-dev

am: a86ef46c

Change-Id: Ic6cfdf0368ff5b55a0cc0a4a41b006947d520cd4
parents b59a8e3a a86ef46c
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -46,6 +46,7 @@
#include "btif_util.h"
#include "btu.h"
#include "device/include/interop.h"
#include "log/log.h"
#include "osi/include/list.h"
#include "osi/include/osi.h"
#include "osi/include/properties.h"
@@ -3541,6 +3542,12 @@ static void handle_app_cur_val_response(tBTA_AV_META_MSG* pmeta_msg,
  bdcpy(rc_addr.address, p_dev->rc_addr);

  app_settings.num_attr = p_rsp->num_val;

  if (app_settings.num_attr > BTRC_MAX_APP_SETTINGS) {
    android_errorWriteLog(0x534e4554, "73824150");
    app_settings.num_attr = BTRC_MAX_APP_SETTINGS;
  }

  for (xx = 0; xx < app_settings.num_attr; xx++) {
    app_settings.attr_ids[xx] = p_rsp->p_vals[xx].attr_id;
    app_settings.attr_values[xx] = p_rsp->p_vals[xx].attr_val;