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

Unified Diff: webrtc/pc/webrtcsdp_unittest.cc

Issue 2675273003: Fixing SDP parsing crash due to invalid port numbers. (Closed)
Patch Set: Created 3 years, 10 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
« webrtc/pc/webrtcsdp.cc ('K') | « webrtc/pc/webrtcsdp.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/pc/webrtcsdp_unittest.cc
diff --git a/webrtc/pc/webrtcsdp_unittest.cc b/webrtc/pc/webrtcsdp_unittest.cc
index 81a5aaf4fe65634bb5bf78b66d08fe46425aeeee..75116e8e33ec5ac5ec5276546ab65b78c0c9ee6f 100644
--- a/webrtc/pc/webrtcsdp_unittest.cc
+++ b/webrtc/pc/webrtcsdp_unittest.cc
@@ -3424,3 +3424,25 @@ TEST_F(WebRtcSdpTest, IceCredentialsInCandidateStringIgnored) {
EXPECT_EQ("ufrag_voice", c.username());
EXPECT_EQ("pwd_voice", c.password());
}
+
+// Test that SDP with an invalid port number in "a=candidate" lines is
+// rejected, without crashing.
+// Regression test for:
+// https://bugs.chromium.org/p/chromium/issues/detail?id=677029
+TEST_F(WebRtcSdpTest, DeserializeInvalidPortInCandidateAttribute) {
+ static const char kSdpWithInvalidCandidatePort[] =
+ "v=0\r\n"
+ "o=- 18446744069414584320 18446462598732840960 IN IP4 127.0.0.1\r\n"
+ "s=-\r\n"
+ "t=0 0\r\n"
+ "m=audio 9 RTP/SAVPF 111\r\n"
+ "c=IN IP4 0.0.0.0\r\n"
+ "a=rtcp:9 IN IP4 0.0.0.0\r\n"
+ "a=ice-ufrag:ufrag_voice\r\na=ice-pwd:pwd_voice\r\n"
+ "a=rtpmap:111 opus/48000/2\r\n"
+ "a=candidate:a0+B/1 1 udp 2130706432 192.168.1.5 12345678 typ host "
+ "generation 2 raddr 192.168.1.1 rport 87654321\r\n";
+
+ JsepSessionDescription jdesc_output(kDummyString);
+ EXPECT_FALSE(SdpDeserialize(kSdpWithInvalidCandidatePort, &jdesc_output));
+}
« webrtc/pc/webrtcsdp.cc ('K') | « webrtc/pc/webrtcsdp.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698