Index: net/tools/quic/quic_socket_utils.cc |
diff --git a/net/tools/quic/quic_socket_utils.cc b/net/tools/quic/quic_socket_utils.cc |
index 4d7d36007601b7d8576b2e5287cdc8634bd38e34..99d35f36f19d012715ffd9dc4dd9b7e15e825b4e 100644 |
--- a/net/tools/quic/quic_socket_utils.cc |
+++ b/net/tools/quic/quic_socket_utils.cc |
@@ -43,14 +43,14 @@ IPAddressNumber QuicSocketUtils::GetAddressFromMsghdr(struct msghdr *hdr) { |
// static |
bool QuicSocketUtils::GetOverflowFromMsghdr(struct msghdr *hdr, |
- int *dropped_packets) { |
+ int *dropped_packets) { |
if (hdr->msg_controllen > 0) { |
struct cmsghdr *cmsg; |
for (cmsg = CMSG_FIRSTHDR(hdr); |
cmsg != NULL; |
cmsg = CMSG_NXTHDR(hdr, cmsg)) { |
if (cmsg->cmsg_type == SO_RXQ_OVFL) { |
- *dropped_packets = *(reinterpret_cast<int*>CMSG_DATA(cmsg)); |
+ memcpy(dropped_packets, CMSG_DATA(cmsg), sizeof(*dropped_packets)); |
return true; |
} |
} |