Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(263)

Unified Diff: webrtc/modules/rtp_rtcp/source/rtp_utility.cc

Issue 2080313002: Merge into M52 Fix buffer overflow parsing malformed rtp packet (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@52
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/rtp_rtcp/source/rtp_utility.cc
diff --git a/webrtc/modules/rtp_rtcp/source/rtp_utility.cc b/webrtc/modules/rtp_rtcp/source/rtp_utility.cc
index bdae3c4806fc24d0a55814f57747d1f80df6d86c..439cd01a9aa09c35ab2be30a03f1371be9280afe 100644
--- a/webrtc/modules/rtp_rtcp/source/rtp_utility.cc
+++ b/webrtc/modules/rtp_rtcp/source/rtp_utility.cc
@@ -319,6 +319,13 @@ void RtpHeaderParser::ParseOneByteExtensionHeader(
return;
}
+ if (ptrRTPDataExtensionEnd - ptr < (len + 1)) {
+ LOG(LS_WARNING) << "Incorrect one-byte extension len: " << (len + 1)
+ << ", bytes left in buffer: "
+ << (ptrRTPDataExtensionEnd - ptr);
+ return;
+ }
+
RTPExtensionType type;
if (ptrExtensionMap->GetType(id, &type) != 0) {
// If we encounter an unknown extension, just skip over it.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698