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

Side by Side Diff: webrtc/p2p/base/stunport.cc

Issue 2837133003: Don't crash if STUN error message is missing ERROR-CODE attribute. (Closed)
Patch Set: Created 3 years, 8 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 unified diff | Download patch
« no previous file with comments | « webrtc/p2p/base/stun_unittest.cc ('k') | webrtc/p2p/base/turnport.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 if (WithinLifetime(rtc::TimeMillis())) { 59 if (WithinLifetime(rtc::TimeMillis())) {
60 port_->requests_.SendDelayed( 60 port_->requests_.SendDelayed(
61 new StunBindingRequest(port_, server_addr_, start_time_), 61 new StunBindingRequest(port_, server_addr_, start_time_),
62 port_->stun_keepalive_delay()); 62 port_->stun_keepalive_delay());
63 } 63 }
64 } 64 }
65 65
66 virtual void OnErrorResponse(StunMessage* response) override { 66 virtual void OnErrorResponse(StunMessage* response) override {
67 const StunErrorCodeAttribute* attr = response->GetErrorCode(); 67 const StunErrorCodeAttribute* attr = response->GetErrorCode();
68 if (!attr) { 68 if (!attr) {
69 LOG(LS_ERROR) << "Bad allocate response error code"; 69 LOG(LS_ERROR) << "Missing binding response error code.";
70 } else { 70 } else {
71 LOG(LS_ERROR) << "Binding error response:" 71 LOG(LS_ERROR) << "Binding error response:"
72 << " class=" << attr->eclass() 72 << " class=" << attr->eclass()
73 << " number=" << attr->number() << " reason='" 73 << " number=" << attr->number() << " reason='"
74 << attr->reason() << "'"; 74 << attr->reason() << "'";
75 } 75 }
76 76
77 port_->OnStunBindingOrResolveRequestFailed(server_addr_); 77 port_->OnStunBindingOrResolveRequestFailed(server_addr_);
78 78
79 int64_t now = rtc::TimeMillis(); 79 int64_t now = rtc::TimeMillis();
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after
510 const std::vector<Candidate>& existing_candidates = Candidates(); 510 const std::vector<Candidate>& existing_candidates = Candidates();
511 std::vector<Candidate>::const_iterator it = existing_candidates.begin(); 511 std::vector<Candidate>::const_iterator it = existing_candidates.begin();
512 for (; it != existing_candidates.end(); ++it) { 512 for (; it != existing_candidates.end(); ++it) {
513 if (it->address() == addr) 513 if (it->address() == addr)
514 return true; 514 return true;
515 } 515 }
516 return false; 516 return false;
517 } 517 }
518 518
519 } // namespace cricket 519 } // namespace cricket
OLDNEW
« no previous file with comments | « webrtc/p2p/base/stun_unittest.cc ('k') | webrtc/p2p/base/turnport.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698