Prevent memory corruption by StreamId::Set
Use RTC_CHECK to crash if attempting to set an RSID whose name's length exceeds the maximum.
BUG=None
Review-Url: https://codereview.webrtc.org/2915913003
Cr-Commit-Position: refs/heads/master@{#18405}
diff --git a/webrtc/common_types.cc b/webrtc/common_types.cc
index b9c4737..c9f7fa1 100644
--- a/webrtc/common_types.cc
+++ b/webrtc/common_types.cc
@@ -25,7 +25,7 @@
void StreamId::Set(const char* data, size_t size) {
// If |data| contains \0, the stream id size might become less than |size|.
- RTC_DCHECK_LE(size, kMaxSize);
+ RTC_CHECK_LE(size, kMaxSize);
memcpy(value_, data, size);
if (size < kMaxSize)
value_[size] = 0;