if copying seeders from behind, use compare_size to advance pointer

master
Dirk Engling 8 months ago
parent d9a5f04675
commit db28465e0c

@ -215,7 +215,7 @@ static size_t return_peers_all( ot_peerlist *peer_list, size_t peer_size, char *
size_t peer_count = bucket_list[bucket].size; size_t peer_count = bucket_list[bucket].size;
while( peer_count-- ) { while( peer_count-- ) {
if( OT_PEERFLAG_D(peers, peer_size) & PEER_FLAG_SEEDING ) { if( OT_PEERFLAG_D(peers, peer_size) & PEER_FLAG_SEEDING ) {
r_end -= peer_size; r_end -= compare_size;
memcpy( r_end, peers, compare_size); memcpy( r_end, peers, compare_size);
} else { } else {
memcpy( reply, peers, compare_size ); memcpy( reply, peers, compare_size );

Loading…
Cancel
Save