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

Side by Side Diff: webrtc/api/webrtcsdp.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 | « no previous file | webrtc/api/webrtcsdp_unittest.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 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 2633 matching lines...) Expand 10 before | Expand all | Expand 10 after
2644 2644
2645 if (!ParseFingerprintAttribute(line, &fingerprint, error)) { 2645 if (!ParseFingerprintAttribute(line, &fingerprint, error)) {
2646 return false; 2646 return false;
2647 } 2647 }
2648 transport->identity_fingerprint.reset(fingerprint); 2648 transport->identity_fingerprint.reset(fingerprint);
2649 } else if (HasAttribute(line, kAttributeSetup)) { 2649 } else if (HasAttribute(line, kAttributeSetup)) {
2650 if (!ParseDtlsSetup(line, &(transport->connection_role), error)) { 2650 if (!ParseDtlsSetup(line, &(transport->connection_role), error)) {
2651 return false; 2651 return false;
2652 } 2652 }
2653 } else if (IsDtlsSctp(protocol) && HasAttribute(line, kAttributeSctpPort)) { 2653 } else if (IsDtlsSctp(protocol) && HasAttribute(line, kAttributeSctpPort)) {
2654 if (media_type != cricket::MEDIA_TYPE_DATA) {
2655 return ParseFailed(
2656 line, "sctp-port attribute found in non-data media description.",
2657 error);
2658 }
2654 int sctp_port; 2659 int sctp_port;
2655 if (!ParseSctpPort(line, &sctp_port, error)) { 2660 if (!ParseSctpPort(line, &sctp_port, error)) {
2656 return false; 2661 return false;
2657 } 2662 }
2658 if (!AddSctpDataCodec(static_cast<DataContentDescription*>(media_desc), 2663 if (!AddSctpDataCodec(static_cast<DataContentDescription*>(media_desc),
2659 sctp_port)) { 2664 sctp_port)) {
2660 return false; 2665 return false;
2661 } 2666 }
2662 } else if (IsRtp(protocol)) { 2667 } else if (IsRtp(protocol)) {
2663 // 2668 //
(...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after
3177 UpdateCodec<AudioContentDescription, cricket::AudioCodec>( 3182 UpdateCodec<AudioContentDescription, cricket::AudioCodec>(
3178 media_desc, payload_type, feedback_param); 3183 media_desc, payload_type, feedback_param);
3179 } else if (media_type == cricket::MEDIA_TYPE_VIDEO) { 3184 } else if (media_type == cricket::MEDIA_TYPE_VIDEO) {
3180 UpdateCodec<VideoContentDescription, cricket::VideoCodec>( 3185 UpdateCodec<VideoContentDescription, cricket::VideoCodec>(
3181 media_desc, payload_type, feedback_param); 3186 media_desc, payload_type, feedback_param);
3182 } 3187 }
3183 return true; 3188 return true;
3184 } 3189 }
3185 3190
3186 } // namespace webrtc 3191 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | webrtc/api/webrtcsdp_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698