-
Notifications
You must be signed in to change notification settings - Fork 131
Closed
Description
In the initialize function map->spare
is initialized to have sizeof(hashmap) + 2 * bucketsz
But it is used both as struct bucket
and as the items stored in the buckets in the setter and getter.
Lines 280 to 290 in 84d0d3b
{ | |
memcpy(map->spare, bitem, map->elsize); | |
memcpy(bitem, eitem, map->elsize); | |
return map->spare; | |
} | |
if (bucket->dib < entry->dib) { | |
memcpy(map->spare, bucket, map->bucketsz); | |
memcpy(bucket, entry, map->bucketsz); | |
memcpy(entry, map->spare, map->bucketsz); | |
eitem = bucket_item(entry); | |
} |
Line 361 in 84d0d3b
memcpy(map->spare, bitem, map->elsize); |
As long as elsize
is smaller than bucketsz
this shouldn't be a problem.
Metadata
Metadata
Assignees
Labels
No labels