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

Unified Diff: webrtc/media/sctp/sctpdataengine.cc

Issue 2318653003: Fixing stack buffer overflow (read) in SctpDataEngine. (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/media/sctp/sctpdataengine.cc
diff --git a/webrtc/media/sctp/sctpdataengine.cc b/webrtc/media/sctp/sctpdataengine.cc
index 2d8d48eee370fe2f79721261df3ed7e39cdd3b66..04a596bc4133ca467e9928feb19ab3aa25aaf5ec 100644
--- a/webrtc/media/sctp/sctpdataengine.cc
+++ b/webrtc/media/sctp/sctpdataengine.cc
@@ -550,8 +550,8 @@ bool SctpDataMediaChannel::Connect() {
// Set the MTU and disable MTU discovery.
// We can only do this after usrsctp_connect or it has no effect.
sctp_paddrparams params = {{0}};
- memcpy(reinterpret_cast<sockaddr*>(&params.spp_address),
- reinterpret_cast<sockaddr*>(&remote_sconn), sizeof(sockaddr));
+ memcpy(reinterpret_cast<sockaddr_conn*>(&params.spp_address), &remote_sconn,
skvlad 2016/09/06 18:29:16 Could this be done as an assignment instead? That
Taylor Brandstetter 2016/09/06 20:00:47 Hmm. It seems like that would work, but I see the
honghaiz3 2016/09/06 22:12:09 Does it matter to reinterpret_cast the dest pointe
Taylor Brandstetter 2016/09/06 22:54:29 Maybe not; again, I was copying the pattern used e
+ sizeof(remote_sconn));
params.spp_flags = SPP_PMTUD_DISABLE;
params.spp_pathmtu = kSctpMtu;
if (usrsctp_setsockopt(sock_, IPPROTO_SCTP, SCTP_PEER_ADDR_PARAMS, &params,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698