From 4277ef206303436070e241e9434d72a42a1f1c9a Mon Sep 17 00:00:00 2001 From: Jeffrey Czyz Date: Sat, 16 Nov 2019 10:40:16 -0800 Subject: [PATCH] Fix segfault in allocator_tests/arena_tests The test uses reinterpret_cast on unallocated memory. Using this memory in printchunk as char* causes a segfault, so have printchunk take void* instead. Zcash: Includes change from bitcoin/bitcoin#13163 --- src/support/lockedpool.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/support/lockedpool.cpp b/src/support/lockedpool.cpp index 52ee13385..6a7e5d628 100644 --- a/src/support/lockedpool.cpp +++ b/src/support/lockedpool.cpp @@ -145,7 +145,7 @@ Arena::Stats Arena::stats() const } #ifdef ARENA_DEBUG -void printchunk(char* base, size_t sz, bool used) { +static void printchunk(void* base, size_t sz, bool used) { std::cout << "0x" << std::hex << std::setw(16) << std::setfill('0') << base << " 0x" << std::hex << std::setw(16) << std::setfill('0') << sz <<