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

Unified Diff: webrtc/p2p/base/stun.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/p2p/base/stun.h ('k') | webrtc/p2p/base/stun_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/p2p/base/stun.cc
diff --git a/webrtc/p2p/base/stun.cc b/webrtc/p2p/base/stun.cc
index 4d6b21ba5465b0769f847aca5d984fd80166c581..8217c029c344c738081d4f68046e4d6c205c85f2 100644
--- a/webrtc/p2p/base/stun.cc
+++ b/webrtc/p2p/base/stun.cc
@@ -115,6 +115,11 @@ const StunErrorCodeAttribute* StunMessage::GetErrorCode() const {
GetAttribute(STUN_ATTR_ERROR_CODE));
}
+int StunMessage::GetErrorCodeValue() const {
+ const StunErrorCodeAttribute* error_attribute = GetErrorCode();
+ return error_attribute ? error_attribute->code() : STUN_ERROR_GLOBAL_FAILURE;
+}
+
const StunUInt16ListAttribute* StunMessage::GetUnknownAttributes() const {
return static_cast<const StunUInt16ListAttribute*>(
GetAttribute(STUN_ATTR_UNKNOWN_ATTRIBUTES));
« no previous file with comments | « webrtc/p2p/base/stun.h ('k') | webrtc/p2p/base/stun_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698