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

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

Issue 2064403002: Fix buffer overflow parsing malformed rtp packet (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
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 131b54ad50ee47f4bf9bded80dbc3aba864200d5..a6f08098e1418278220407b89005a4bd81fba6e8 100644
--- a/webrtc/modules/rtp_rtcp/source/rtp_utility.cc
+++ b/webrtc/modules/rtp_rtcp/source/rtp_utility.cc
@@ -323,6 +323,13 @@ void RtpHeaderParser::ParseOneByteExtensionHeader(
return;
}
+ if (ptrRTPDataExtensionEnd - ptr < (len+1)) {
åsapersson 2016/06/16 12:22:29 check format here and below (len + 1)
danilchap 2016/06/16 12:54:22 Done.
+ LOG(LS_WARNING) << "Incorrect one-byte extension len: " << (len+1)
+ << ", bytes left in buffer: "
+ << (ptrRTPDataExtensionEnd - ptr);
åsapersson 2016/06/16 12:22:29 maybe also log the id
danilchap 2016/06/16 12:54:22 For this kind of error id is not really interestin
+ 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