klocwork: fix risk issues

This commit is contained in:
Hong, Yang A
2022-05-31 06:30:18 +00:00
parent 7bf5a9f5cd
commit f194a85d51
16 changed files with 62 additions and 11 deletions

View File

@@ -760,6 +760,11 @@ u64a byte_size(const vector<DataBlock> &corpus_blocks) {
total += block.payload.size();
}
if (total == 0) {
assert(0);
throw std::invalid_argument("Empty corpus.");
}
return total;
}