Commit 0cb2105d authored by Petri Hintukainen's avatar Petri Hintukainen

Check for overflow

parent 9988319b
...@@ -908,6 +908,10 @@ static int _parse_dir(const uint8_t *data, uint32_t length, struct udf_dir *dir) ...@@ -908,6 +908,10 @@ static int _parse_dir(const uint8_t *data, uint32_t length, struct udf_dir *dir)
while (p < end - 16) { while (p < end - 16) {
size_t used; size_t used;
if (dir->num_entries == UINT32_MAX) {
return 0;
}
tag_id = decode_descriptor_tag(p); tag_id = decode_descriptor_tag(p);
if (tag_id != ECMA_FileIdentifierDescriptor) { if (tag_id != ECMA_FileIdentifierDescriptor) {
udf_error("unexpected tag %d in directory file\n", tag_id); udf_error("unexpected tag %d in directory file\n", tag_id);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment