add a sanity check to fuchsia importer

This commit is contained in:
Simon Cruanes
2025-06-02 10:41:09 -04:00
parent 18242189e1
commit bbf225b788

View File

@@ -188,6 +188,12 @@ std::pair<bool, Record> read_next_record(std::vector<uint8_t> const &input, size
CHECK_BOUND(offset + 8*len_word);
Record r{(uint64_t *)&input[offset], len_word, header};
if (len_word == 0) {
fprintf(stderr, "warning: invalid record with length=0 at offset %" PRIu64 "\n", offset); \
return std::make_pair(false,Record{}); \
}
offset += 8 * len_word;
return std::make_pair(true, r);
}