Add safeguards against signalling peer-reflexive candidates.

BUG=4208
R=juberti@google.com

Review URL: https://webrtc-codereview.appspot.com/50799004

Cr-Commit-Position: refs/heads/master@{#9104}
This commit is contained in:
Peter Thatcher 2015-04-28 09:06:26 -07:00
parent ae331349c6
commit 019087f5bb
2 changed files with 8 additions and 0 deletions

View File

@ -1770,6 +1770,8 @@ void BuildCandidate(const std::vector<Candidate>& candidates,
type = kCandidateRelay;
} else {
ASSERT(false);
// Never write out candidates if we don't know the type.
continue;
}
InitAttrLine(kAttributeCandidate, &os);

View File

@ -559,6 +559,12 @@ void Transport::OnChannelRequestSignaling_s() {
void Transport::OnChannelCandidateReady(TransportChannelImpl* channel,
const Candidate& candidate) {
// We should never signal peer-reflexive candidates.
if (candidate.type() == PRFLX_PORT_TYPE) {
ASSERT(false);
return;
}
ASSERT(worker_thread()->IsCurrent());
rtc::CritScope cs(&crit_);
ready_candidates_.push_back(candidate);