mirror of
https://github.com/wolfpld/tracy.git
synced 2026-06-08 00:23:47 +00:00
add a sanity check to fuchsia importer
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user