diff --git a/src/zmq_reader.cpp b/src/zmq_reader.cpp index 6ad8721..1ed573d 100644 --- a/src/zmq_reader.cpp +++ b/src/zmq_reader.cpp @@ -338,6 +338,11 @@ static std::vector construct_monero_block_blob(rapidjson::Value* value) auto arr = outputs->value.GetArray(); + if (arr.Empty()) { + LOGWARN(3, "construct_monero_block_blob: outputs array is empty"); + return empty_blob; + } + writeVarint(arr.Size(), blob); for (rapidjson::Value* i = arr.begin(); i != arr.end(); ++i) { @@ -385,7 +390,7 @@ static std::vector construct_monero_block_blob(rapidjson::Value* value) } std::vector t; - if (!from_hex(extra.c_str(), extra.length(), t) || t.empty()) { + if (!from_hex(extra.c_str(), extra.length(), t) || (t.size() < HASH_SIZE + 1)) { LOGWARN(3, "construct_monero_block_blob: invalid extra " << extra); return empty_blob; }