aboutsummaryrefslogtreecommitdiff
path: root/src/bench/checkblock.cpp
diff options
context:
space:
mode:
authorBen Woosley <[email protected]>2018-10-05 16:43:09 +0900
committerBen Woosley <[email protected]>2018-10-05 16:48:16 +0900
commitb09c81454eb2fc7fb8d29301ce7f4aa3aaee35a5 (patch)
tree4cb69bb0e46ee66155fb023ecec70c815a5aa01f /src/bench/checkblock.cpp
parentMerge #14395: Fix typos and cleanup (diff)
downloaddiscoin-b09c81454eb2fc7fb8d29301ce7f4aa3aaee35a5.tar.xz
discoin-b09c81454eb2fc7fb8d29301ce7f4aa3aaee35a5.zip
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 6f03581c4..e325333c0 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