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

Commit 5228fa47 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "a2dp_fuzz : Bug Fix" am: 52286539 am: 84f08b98 am: 80cfcb93 am:...

Merge "a2dp_fuzz : Bug Fix" am: 52286539 am: 84f08b98 am: 80cfcb93 am: eff651cd am: 925b2134

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/2060428



Change-Id: I28bb11a146093c2c14ae24b68c1ebcac4c847b99
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 52bd4a10 925b2134
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -34,6 +34,8 @@
#define SDP_MAX_ELEM_LEN 1024
#define SDP_MAX_ATTRS 1024

constexpr int32_t kMaxVectorSize = 1000;

struct SDP_Sequence_Helper {
  uint8_t num_elem;
  std::shared_ptr<uint8_t> type;
@@ -113,7 +115,8 @@ tSDP_DISC_ATVAL generateArbitrarySdpDiscAttrVal(FuzzedDataProvider* fdp) {
std::shared_ptr<tSDP_DISC_ATTR> generateArbitrarySdpDiscAttr(
    FuzzedDataProvider* fdp, bool allow_null) {
  // Give it a chance to return a nullptr
  if (allow_null && !fdp->ConsumeBool()) {
  if ((allow_null && !fdp->ConsumeBool()) ||
      sdp_disc_attr_vect.size() > kMaxVectorSize) {
    return nullptr;
  }