Skip to content

Commit

Permalink
Merge pull request libbitcoin#176 from evoskuil/version3
Browse files Browse the repository at this point in the history
Patch remap safety issues in slab/record hash tables.
  • Loading branch information
evoskuil authored Jan 21, 2018
2 parents ca07e3f + 767f430 commit 000ce55
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions include/bitcoin/database/impl/record_hash_table.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ void record_hash_table<KeyType>::update(const KeyType& key,
// Found.
if (item.compare(key))
{
const auto data = REMAP_ADDRESS(item.data());
auto serial = make_unsafe_serializer(data);
const auto memory = item.data();
auto serial = make_unsafe_serializer(REMAP_ADDRESS(memory));
write(serial);
return;
}
Expand Down
4 changes: 2 additions & 2 deletions include/bitcoin/database/impl/slab_hash_table.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ file_offset slab_hash_table<KeyType>::update(const KeyType& key,
// Found.
if (item.compare(key))
{
const auto data = REMAP_ADDRESS(item.data());
auto serial = make_unsafe_serializer(data);
const auto memory = item.data();
auto serial = make_unsafe_serializer(REMAP_ADDRESS(memory));
write(serial);
return item.offset();
}
Expand Down

0 comments on commit 000ce55

Please sign in to comment.