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

Side by Side Diff: content/browser/renderer_host/p2p/socket_host.h

Issue 607633002: Fix boundary check problems in socket_host.cc. See the bug for the full list of security issues fix… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2125
Patch Set: Created 6 years, 2 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 | content/browser/renderer_host/p2p/socket_host.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 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_H_ 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_H_ 6 #define CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_H_
7 7
8 #include "base/memory/weak_ptr.h" 8 #include "base/memory/weak_ptr.h"
9 #include "content/common/content_export.h" 9 #include "content/common/content_export.h"
10 #include "content/common/p2p_socket_type.h" 10 #include "content/common/p2p_socket_type.h"
(...skipping 15 matching lines...) Expand all
26 26
27 namespace content { 27 namespace content {
28 class P2PMessageThrottler; 28 class P2PMessageThrottler;
29 29
30 namespace packet_processing_helpers { 30 namespace packet_processing_helpers {
31 31
32 // This method can handle only RTP packet, otherwise this method must not be 32 // This method can handle only RTP packet, otherwise this method must not be
33 // called. It will try to do, 1. update absolute send time extension header 33 // called. It will try to do, 1. update absolute send time extension header
34 // if present with current time and 2. update HMAC in RTP packet. 34 // if present with current time and 2. update HMAC in RTP packet.
35 // If abs_send_time is 0, ApplyPacketOption will get current time from system. 35 // If abs_send_time is 0, ApplyPacketOption will get current time from system.
36 CONTENT_EXPORT bool ApplyPacketOptions(char* data, int length, 36 CONTENT_EXPORT bool ApplyPacketOptions(char* data,
37 size_t length,
37 const rtc::PacketOptions& options, 38 const rtc::PacketOptions& options,
38 uint32 abs_send_time); 39 uint32 abs_send_time);
39 40
40 // Helper method which finds RTP ofset and length if the packet is encapsulated 41 // Helper method which finds RTP ofset and length if the packet is encapsulated
41 // in a TURN Channel Message or TURN Send Indication message. 42 // in a TURN Channel Message or TURN Send Indication message.
42 CONTENT_EXPORT bool GetRtpPacketStartPositionAndLength(const char* data, 43 CONTENT_EXPORT bool GetRtpPacketStartPositionAndLength(
43 int length, 44 const char* data,
44 int* rtp_start_pos, 45 size_t length,
45 int* rtp_packet_length); 46 size_t* rtp_start_pos,
47 size_t* rtp_packet_length);
48
46 // Helper method which updates absoulute send time extension if present. 49 // Helper method which updates absoulute send time extension if present.
47 CONTENT_EXPORT bool UpdateRtpAbsSendTimeExtn(char* rtp, int length, 50 CONTENT_EXPORT bool UpdateRtpAbsSendTimeExtension(char* rtp,
48 int extension_id, 51 size_t length,
49 uint32 abs_send_time); 52 int extension_id,
53 uint32 abs_send_time);
50 54
51 } // packet_processing_helpers 55 } // packet_processing_helpers
52 56
53 // Base class for P2P sockets. 57 // Base class for P2P sockets.
54 class CONTENT_EXPORT P2PSocketHost { 58 class CONTENT_EXPORT P2PSocketHost {
55 public: 59 public:
56 static const int kStunHeaderSize = 20; 60 static const int kStunHeaderSize = 20;
57 // Creates P2PSocketHost of the specific type. 61 // Creates P2PSocketHost of the specific type.
58 static P2PSocketHost* Create(IPC::Sender* message_sender, 62 static P2PSocketHost* Create(IPC::Sender* message_sender,
59 int socket_id, 63 int socket_id,
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 RenderProcessHost::WebRtcRtpPacketCallback packet_dump_callback_; 150 RenderProcessHost::WebRtcRtpPacketCallback packet_dump_callback_;
147 151
148 base::WeakPtrFactory<P2PSocketHost> weak_ptr_factory_; 152 base::WeakPtrFactory<P2PSocketHost> weak_ptr_factory_;
149 153
150 DISALLOW_COPY_AND_ASSIGN(P2PSocketHost); 154 DISALLOW_COPY_AND_ASSIGN(P2PSocketHost);
151 }; 155 };
152 156
153 } // namespace content 157 } // namespace content
154 158
155 #endif // CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_H_ 159 #endif // CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/renderer_host/p2p/socket_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698