Skip to content

Commit

Permalink
Merge to M80: Add safety checks in RtpPacket::ZeroMutableExtensions a…
Browse files Browse the repository at this point in the history
…nd fuzz it

// Because ios_sim_x64_dbg_ios10 is broken on release brunch:
// https://bugs.chromium.org/p/webrtc/issues/detail?id=11277

TBR=nisse@webrtc.org
(cherry picked from commit db6ca7f)

No-Try: true
Bug: chromium:1042535
Change-Id: I0f7ef1086631b5beb2e0c89d57534d2551289117
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/166441
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Original-Commit-Position: refs/heads/master@{#30303}
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/166520
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/branch-heads/3987@{#6}
Cr-Branched-From: 1256d9b-refs/heads/master@{#30022}
  • Loading branch information
Ilya Nikolaevskiy authored and Commit Bot committed Jan 21, 2020
1 parent 7584593 commit 7a0e44c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
12 changes: 7 additions & 5 deletions modules/rtp_rtcp/source/rtp_packet.cc
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,13 @@ void RtpPacket::ZeroMutableExtensions() {
break;
}
case RTPExtensionType::kRtpExtensionVideoTiming: {
// Nullify 3 last entries: packetization delay and 2 network timestamps.
// Each of them is 2 bytes.
memset(
WriteAt(extension.offset + VideoSendTiming::kPacerExitDeltaOffset),
0, 6);
// Nullify last entries, starting at pacer delay.
// These are set by pacer and SFUs
if (VideoSendTiming::kPacerExitDeltaOffset < extension.length) {
memset(WriteAt(extension.offset +
VideoSendTiming::kPacerExitDeltaOffset),
0, extension.length - VideoSendTiming::kPacerExitDeltaOffset);
}
break;
}
case RTPExtensionType::kRtpExtensionTransportSequenceNumber:
Expand Down
3 changes: 3 additions & 0 deletions test/fuzzers/rtp_packet_fuzzer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -156,5 +156,8 @@ void FuzzOneInput(const uint8_t* data, size_t size) {
break;
}
}

// Check that zero-ing mutable extensions wouldn't cause any problems.
packet.ZeroMutableExtensions();
}
} // namespace webrtc

0 comments on commit 7a0e44c

Please sign in to comment.