diff --git a/include/libtorrent/bt_peer_connection.hpp b/include/libtorrent/bt_peer_connection.hpp index 81a645cd6..dbc93fd0c 100644 --- a/include/libtorrent/bt_peer_connection.hpp +++ b/include/libtorrent/bt_peer_connection.hpp @@ -370,7 +370,7 @@ private: // the peer indicated that it supports the // extension protocol bool m_supports_extensions; - char m_reserved_bits[20]; + char m_reserved_bits[8]; #endif bool m_supports_dht_port; bool m_supports_fast; diff --git a/src/bt_peer_connection.cpp b/src/bt_peer_connection.cpp index c7767c969..a8b208a61 100644 --- a/src/bt_peer_connection.cpp +++ b/src/bt_peer_connection.cpp @@ -2463,7 +2463,7 @@ namespace libtorrent #endif #ifndef DISABLE_EXTENSIONS - std::memcpy(m_reserved_bits, recv_buffer.begin, 20); + std::memcpy(m_reserved_bits, recv_buffer.begin, 8); if ((recv_buffer[5] & 0x10)) m_supports_extensions = true; #endif