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

Commit 29a0c7e0 authored by Presubmit Automerger Backend's avatar Presubmit Automerger Backend
Browse files

[automerge] Fix 2 OOB bugs in LeAudioBroadcasterImpl::UpdateMetadata 2p: 03f6330d

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

Bug: 275551881
Change-Id: I145e0e6df1d70a480180f0cf58b491eae302a52e
Merged-In: I6172d11a9c745018ca40e2df8b0e70f4f9728fde
parents cf49560b 03f6330d
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -302,6 +302,10 @@ class LeAudioBroadcasterImpl : public LeAudioBroadcaster, public BigCallbacks {
            le_audio::types::kLeAudioMetadataTypeStreamingAudioContext);
        if (stream_context_vec) {
          auto pp = stream_context_vec.value().data();
          if (stream_context_vec.value().size() < 2) {
            LOG_ERROR("stream_context_vec.value() size < 2");
            return;
          }
          UINT16_TO_STREAM(pp, context_type.value());
        }
      }
@@ -310,6 +314,10 @@ class LeAudioBroadcasterImpl : public LeAudioBroadcaster, public BigCallbacks {
          ltv.Find(le_audio::types::kLeAudioMetadataTypeStreamingAudioContext);
      if (stream_context_vec) {
        auto pp = stream_context_vec.value().data();
        if (stream_context_vec.value().size() < 2) {
          LOG_ERROR("stream_context_vec.value() size < 2");
          return;
        }
        STREAM_TO_UINT16(context_type.value_ref(), pp);
      }