From 767f43052aca82fb6c9f95deea1c57f494182744 Mon Sep 17 00:00:00 2001 From: evoskuil Date: Sun, 21 Jan 2018 06:11:49 -0800 Subject: [PATCH] Patch remap safety issues in slab/record hash tables. --- include/bitcoin/database/impl/record_hash_table.ipp | 4 ++-- include/bitcoin/database/impl/slab_hash_table.ipp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/bitcoin/database/impl/record_hash_table.ipp b/include/bitcoin/database/impl/record_hash_table.ipp index 22c57e367..43aa6796c 100644 --- a/include/bitcoin/database/impl/record_hash_table.ipp +++ b/include/bitcoin/database/impl/record_hash_table.ipp @@ -78,8 +78,8 @@ void record_hash_table::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; } diff --git a/include/bitcoin/database/impl/slab_hash_table.ipp b/include/bitcoin/database/impl/slab_hash_table.ipp index 1cdea866a..955127252 100644 --- a/include/bitcoin/database/impl/slab_hash_table.ipp +++ b/include/bitcoin/database/impl/slab_hash_table.ipp @@ -80,8 +80,8 @@ file_offset slab_hash_table::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(); }