aboutsummaryrefslogtreecommitdiff
path: root/src/bench/checkblock.cpp
diff options
context:
space:
mode:
authorBen Woosley <ben.woosley@gmail.com>2018-10-05 16:43:09 +0900
committerBen Woosley <ben.woosley@gmail.com>2018-10-05 16:48:16 +0900
commitb09c81454eb2fc7fb8d29301ce7f4aa3aaee35a5 (patch)
tree4cb69bb0e46ee66155fb023ecec70c815a5aa01f /src/bench/checkblock.cpp
parentf504a1402afd0760e9d348ecc8bad0094aa7d705 (diff)
Don't access out of bounds array entry array[sizeof(array)]
Diffstat (limited to 'src/bench/checkblock.cpp')
-rw-r--r--src/bench/checkblock.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/bench/checkblock.cpp b/src/bench/checkblock.cpp
index 6f03581c4b..e325333c01 100644
--- a/src/bench/checkblock.cpp
+++ b/src/bench/checkblock.cpp
@@ -20,7 +20,7 @@ namespace block_bench {
static void DeserializeBlockTest(benchmark::State& state)
{
CDataStream stream((const char*)block_bench::block413567,
- (const char*)&block_bench::block413567[sizeof(block_bench::block413567)],
+ (const char*)block_bench::block413567 + sizeof(block_bench::block413567),
SER_NETWORK, PROTOCOL_VERSION);
char a = '\0';
stream.write(&a, 1); // Prevent compaction
@@ -36,7 +36,7 @@ static void DeserializeBlockTest(benchmark::State& state)
static void DeserializeAndCheckBlockTest(benchmark::State& state)
{
CDataStream stream((const char*)block_bench::block413567,
- (const char*)&block_bench::block413567[sizeof(block_bench::block413567)],
+ (const char*)block_bench::block413567 + sizeof(block_bench::block413567),
SER_NETWORK, PROTOCOL_VERSION);
char a = '\0';
stream.write(&a, 1); // Prevent compaction