Bitcoin full node and query server

Aug 22, 2024

View in context in the libbitcoin Slack #general mirror.

evoskuil23:05
After some refactoring and a new release build run with the debugger attached, I hit a break in witness deserialization. There was a change to deserialization such that a byte vector (data_chunk) is allocated by the stream reader and returned as a raw pointer. This was immediately assigned to a shared_ptr, which will accept either a nullptr (shared_ptr.empty()) or a pointer to the data_chunk object. The pointer is then dereferenced, which is a segfault if the value was nullptr. So just needed to check the return value of the pointer or (bool)reader and exist the witness reader early.