1
0
mirror of git://erdgeist.org/opentracker synced 2025-01-13 16:30:06 +00:00

if copying seeders from behind, use compare_size to advance pointer

This commit is contained in:
Dirk Engling 2024-04-06 21:35:15 +02:00
parent d9a5f04675
commit db28465e0c

View File

@ -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 );