summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDirk Engling <erdgeist@erdgeist.org>2026-11-28 21:16:14 +0100
committerDirk Engling <erdgeist@erdgeist.org>2026-11-28 21:16:14 +0100
commit0d51f4ce3826f78d23bfa48b2ac447f1fd91a0af (patch)
treeadd4d99abf1d194e2ded94b70cbc062aee58e96c /src
parent70485a0ecf6b1ae9520deb4af0490fdb48643836 (diff)
When sorting/unique-ing client provided info_hashes, the memcpy's src and dest might be identical, so use memmove
Diffstat (limited to 'src')
-rw-r--r--src/ot_http.c2
1 files changed, 1 insertions, 1 deletions
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,
536 qsort(multiscrape_buf, numwant, sizeof(ot_hash), compare_hash); 536 qsort(multiscrape_buf, numwant, sizeof(ot_hash), compare_hash);
537 for (i = unique = 1; i < numwant; ++i) 537 for (i = unique = 1; i < numwant; ++i)
538 if (memcmp(multiscrape_buf[i], multiscrape_buf[unique - 1], sizeof(ot_hash))) 538 if (memcmp(multiscrape_buf[i], multiscrape_buf[unique - 1], sizeof(ot_hash)))
539 memcpy(multiscrape_buf[unique++], multiscrape_buf[i], sizeof(ot_hash)); 539 memmove(multiscrape_buf[unique++], multiscrape_buf[i], sizeof(ot_hash));
540 numwant = unique; 540 numwant = unique;
541 541
542 /* Enough for http header + whole scrape string */ 542 /* Enough for http header + whole scrape string */