diff options
| author | Dirk Engling <erdgeist@erdgeist.org> | 2026-10-24 15:48:52 +0200 |
|---|---|---|
| committer | Dirk Engling <erdgeist@erdgeist.org> | 2026-10-24 15:48:52 +0200 |
| commit | 5fc1e46fd39d68dc6202055a11a2fc3e26c384ed (patch) | |
| tree | 52d0f140bd906e2408ea13535f27a194d6d166df | |
| parent | 5c08c61c176a69bd73843329efe66da922c9bf60 (diff) | |
Copy the correct amount of bytes for an dynamic accesslist entry
| -rw-r--r-- | ot_accesslist.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ot_accesslist.c b/ot_accesslist.c index a090cc6..24b334c 100644 --- a/ot_accesslist.c +++ b/ot_accesslist.c | |||
| @@ -323,7 +323,7 @@ static void *accesslist_adddel_worker(char *fifoname, ot_accesslist *_Atomic | |||
| 323 | ot_accesslist *accesslist_new = accesslist_make(*removing_from, (*removing_from)->size - 1); | 323 | ot_accesslist *accesslist_new = accesslist_make(*removing_from, (*removing_from)->size - 1); |
| 324 | if (accesslist_new) { | 324 | if (accesslist_new) { |
| 325 | memcpy(accesslist_new->list, (*removing_from)->list, sizeof(ot_hash) * off); | 325 | memcpy(accesslist_new->list, (*removing_from)->list, sizeof(ot_hash) * off); |
| 326 | memcpy(accesslist_new->list + off, (*removing_from)->list + off + 1, (*removing_from)->size - off - 1); | 326 | memcpy(accesslist_new->list + off, (*removing_from)->list + off + 1, sizeof(ot_hash) * ((*removing_from)->size - off - 1)); |
| 327 | (*removing_from)->base = g_now_minutes; | 327 | (*removing_from)->base = g_now_minutes; |
| 328 | *removing_from = accesslist_new; | 328 | *removing_from = accesslist_new; |
| 329 | } | 329 | } |
| @@ -348,7 +348,7 @@ static void *accesslist_adddel_worker(char *fifoname, ot_accesslist *_Atomic | |||
| 348 | if (accesslist_new) { | 348 | if (accesslist_new) { |
| 349 | memcpy(accesslist_new->list, (*adding_to)->list, sizeof(ot_hash) * off); | 349 | memcpy(accesslist_new->list, (*adding_to)->list, sizeof(ot_hash) * off); |
| 350 | memcpy(accesslist_new->list + off, info_hash, sizeof(info_hash)); | 350 | memcpy(accesslist_new->list + off, info_hash, sizeof(info_hash)); |
| 351 | memcpy(accesslist_new->list + off + 1, (*adding_to)->list + off, (*adding_to)->size - off); | 351 | memcpy(accesslist_new->list + off + 1, (*adding_to)->list + off, sizeof(ot_hash) * ((*adding_to)->size - off)); |
| 352 | (*adding_to)->base = g_now_minutes; | 352 | (*adding_to)->base = g_now_minutes; |
| 353 | *adding_to = accesslist_new; | 353 | *adding_to = accesslist_new; |
| 354 | } | 354 | } |
