Bug 1383272 - fixing incorrect comparison in RtpStreamId::Parse(...) r=bwc
authorMichael Froman <mfroman@mozilla.com>
Fri, 21 Jul 2017 15:54:11 -0500
changeset 419010 5b8225dac5532f0726c9a5f9bf81e97ce8367331
parent 419009 5e1c7ab7ec0768714acb3c3f79b9ced64e5b639c
child 419011 4ed067a3c2941aada4f32eb63b68d5574a2a2c80
push id7566
push usermtabara@mozilla.com
push dateWed, 02 Aug 2017 08:25:16 +0000
treeherdermozilla-beta@86913f512c3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbwc
bugs1383272
milestone56.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1383272 - fixing incorrect comparison in RtpStreamId::Parse(...) r=bwc When adding the length check for parsing RtpStreamId, I incorrectly used the '<=' operator instead of the '>' operator. MozReview-Commit-ID: 46XZBqWxkBc
media/webrtc/trunk/webrtc/modules/rtp_rtcp/source/rtp_header_extensions.cc
--- a/media/webrtc/trunk/webrtc/modules/rtp_rtcp/source/rtp_header_extensions.cc
+++ b/media/webrtc/trunk/webrtc/modules/rtp_rtcp/source/rtp_header_extensions.cc
@@ -217,17 +217,17 @@ bool PlayoutDelayLimits::Write(uint8_t* 
 }
 
 // RtpStreamId.
 constexpr RTPExtensionType RtpStreamId::kId;
 constexpr const char* RtpStreamId::kUri;
 
 bool RtpStreamId::Parse(rtc::ArrayView<const uint8_t> data, StreamId* rsid) {
   if (data.empty() || data[0] == 0 ||  // Valid rsid can't be empty.
-      data.size() <= StreamId::kMaxSize) // mozilla
+      data.size() > StreamId::kMaxSize) // mozilla
     return false;
   // If there is a \0 character in the middle of the |data|, it will be treated
   // as the end of the StreamId when StreamId::size() is called.
   rsid->Set(data);
   RTC_DCHECK(!rsid->empty());
   return true;
 }
 
@@ -235,17 +235,17 @@ bool RtpStreamId::Write(uint8_t* data, c
   RTC_DCHECK_GE(rsid.size(), 1);
   RTC_DCHECK_LE(rsid.size(), StreamId::kMaxSize);
   memcpy(data, rsid.data(), rsid.size());
   return true;
 }
 
 bool RtpStreamId::Parse(rtc::ArrayView<const uint8_t> data, std::string* rsid) {
   if (data.empty() || data[0] == 0 ||  // Valid rsid can't be empty.
-      data.size() <= StreamId::kMaxSize) // mozilla
+      data.size() > StreamId::kMaxSize) // mozilla
     return false;
   const char* str = reinterpret_cast<const char*>(data.data());
   // If there is a \0 character in the middle of the |data|, treat it as end of
   // the string. Well-formed rsid shouldn't contain it.
   rsid->assign(str, strnlen(str, data.size()));
   RTC_DCHECK(!rsid->empty());
   return true;
 }