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

Side by Side Diff: webrtc/api/webrtcsdp_unittest.cc

Issue 2354723002: Fixing heap read overflow when "sctp-port" is in a video description. (Closed)
Patch Set: Created 4 years, 3 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/api/webrtcsdp.cc ('k') | no next file » | 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 2011 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2011 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 3165 matching lines...) Expand 10 before | Expand all | Expand 10 after
3176 EXPECT_TRUE( 3176 EXPECT_TRUE(
3177 SdpDeserialize(kUnifiedPlanSdpFullString, &deserialized_description)); 3177 SdpDeserialize(kUnifiedPlanSdpFullString, &deserialized_description));
3178 3178
3179 EXPECT_TRUE(CompareSessionDescription(jdesc_, deserialized_description)); 3179 EXPECT_TRUE(CompareSessionDescription(jdesc_, deserialized_description));
3180 } 3180 }
3181 3181
3182 TEST_F(WebRtcSdpTest, SerializeUnifiedPlanSessionDescription) { 3182 TEST_F(WebRtcSdpTest, SerializeUnifiedPlanSessionDescription) {
3183 MakeUnifiedPlanDescription(); 3183 MakeUnifiedPlanDescription();
3184 TestSerialize(jdesc_, true); 3184 TestSerialize(jdesc_, true);
3185 } 3185 }
3186
3187 // Regression test for heap overflow bug:
3188 // https://bugs.chromium.org/p/chromium/issues/detail?id=647916
3189 TEST_F(WebRtcSdpTest, DeserializeSctpPortInVideoDescription) {
3190 JsepSessionDescription jdesc_output(kDummyString);
3191
3192 // The issue occurs when the sctp-port attribute is found in a video
3193 // description. The actual heap overflow occurs when parsing the fmtp line.
3194 const char kSdpWithSctpPortInVideoDescription[] =
3195 "v=0\r\n"
3196 "o=- 18446744069414584320 18446462598732840960 IN IP4 127.0.0.1\r\n"
3197 "s=-\r\n"
3198 "t=0 0\r\n"
3199 "m=video 9 UDP/DTLS/SCTP 120\r\n"
3200 "a=sctp-port 5000\r\n"
3201 "a=fmtp:108 foo=10\r\n";
3202
3203 ExpectParseFailure(std::string(kSdpWithSctpPortInVideoDescription),
3204 "sctp-port");
3205 }
OLDNEW
« no previous file with comments | « webrtc/api/webrtcsdp.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698