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

Commit eff651cd 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

parents d67e68e9 80cfcb93
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;
  }