Re: [PATCH] isofs: bound empty directory blocks in isofs_read_level3_size()

From: Matthias Goergens

Date: Tue Sep 29 2026 - 23:40:14 EST


Hi Honza,

> Any reason why don't you do just "++i > 100" here and completely
> remove the empty_blocks variable?

Yes: i has one other use. The "if (i == 1)" further down records
where the second section starts (i_next_section_block/offset).
Counting empty blocks in i would move i past 1 before the second
record is read when an empty block sits between the first two
records, so the next-section link stays 0 and isofs_get_blocks()
reads past the first extent into whatever follows it on disk. I
tried your variant on a two-section image with one empty block
between the records: v1 reads the file correctly, the variant returns
different bytes.

I'm happy to send a v2 that adds a comment saying why the count stays
out of i, if you'd like one.

Thanks,
Matthias