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

Commit c78316b4 authored by Scott Bauer's avatar Scott Bauer Committed by android-build-merger
Browse files

Read the correct amount of attributes am: 1abeb7d1

am: abc894b0

Change-Id: I84761b2140ea4d00caabd18108938a2901ffe71c
parents 8637f127 abc894b0
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -1463,9 +1463,14 @@ bool bta_gattc_cache_load(tBTA_GATTC_CLCB* p_clcb) {
    goto done;
  }

  if (num_attr > 0xFFFF) {
    APPL_TRACE_ERROR("%s: more than 0xFFFF GATT attributes: %s", __func__, fname);
    goto done;
  }

  attr = (tBTA_GATTC_NV_ATTR*)osi_malloc(sizeof(tBTA_GATTC_NV_ATTR) * num_attr);

  if (fread(attr, sizeof(tBTA_GATTC_NV_ATTR), 0xFF, fd) != num_attr) {
  if (fread(attr, sizeof(tBTA_GATTC_NV_ATTR), num_attr, fd) != num_attr) {
    APPL_TRACE_ERROR("%s: can't read GATT attributes: %s", __func__, fname);
    goto done;
  }