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

Unified Diff: webrtc/api/webrtcsdp.cc

Issue 2570803003: ParseCandidate(): Refactor to fix memcheck false positive. (Closed)
Patch Set: Created 4 years 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 | webrtc/p2p/base/port.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/api/webrtcsdp.cc
diff --git a/webrtc/api/webrtcsdp.cc b/webrtc/api/webrtcsdp.cc
index b700d8550e78c4aed316f6f4aab9bee10025d51a..f0e94b62210e2962c039274ee49942b28db75b41 100644
--- a/webrtc/api/webrtcsdp.cc
+++ b/webrtc/api/webrtcsdp.cc
@@ -1034,10 +1034,18 @@ bool ParseCandidate(const std::string& message, Candidate* candidate,
SocketAddress address(connection_address, port);
cricket::ProtocolType protocol;
- if (!StringToProto(transport.c_str(), &protocol) ||
- protocol == cricket::PROTO_TLS) {
+ if (!StringToProto(transport.c_str(), &protocol)) {
return ParseFailed(first_line, "Unsupported transport type.", error);
}
+ switch (protocol) {
+ case cricket::PROTO_UDP:
+ case cricket::PROTO_TCP:
+ case cricket::PROTO_SSLTCP:
+ // Supported protocol.
+ break;
+ default:
+ return ParseFailed(first_line, "Unsupported transport type.", error);
+ }
std::string candidate_type;
const std::string& type = fields[7];
« no previous file with comments | « no previous file | webrtc/p2p/base/port.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698