From 0d51f4ce3826f78d23bfa48b2ac447f1fd91a0af Mon Sep 17 00:00:00 2001 From: Dirk Engling Date: Sat, 28 Nov 2026 21:16:14 +0100 Subject: When sorting/unique-ing client provided info_hashes, the memcpy's src and dest might be identical, so use memmove --- src/ot_http.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/ot_http.c') diff --git a/src/ot_http.c b/src/ot_http.c index 406fec3..4bd5431 100644 --- a/src/ot_http.c +++ b/src/ot_http.c @@ -536,7 +536,7 @@ static ssize_t http_handle_scrape(const int64_t sock, struct ot_workstruct *ws, qsort(multiscrape_buf, numwant, sizeof(ot_hash), compare_hash); for (i = unique = 1; i < numwant; ++i) if (memcmp(multiscrape_buf[i], multiscrape_buf[unique - 1], sizeof(ot_hash))) - memcpy(multiscrape_buf[unique++], multiscrape_buf[i], sizeof(ot_hash)); + memmove(multiscrape_buf[unique++], multiscrape_buf[i], sizeof(ot_hash)); numwant = unique; /* Enough for http header + whole scrape string */ -- cgit v1.3