mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-24 23:23:58 +00:00
Ext2FS: Fix indirect-blocks iteration
For singly-indirect blocks, "callback" is just "add_block". For doubly-indirect blocks, "callback" is the lambda function iterating on singly-indirect blocks: so instead of adding itself to the list, the doubly-indirect block will add all its childs, but they add themselves again when they run the callback of singly-indirect blocks. And nothing adds the doubly-indirect block itself :( This leads to a double free of all child blocks of the doubly-indirect block, which is the failed assert described in #1549. Closes: #1549.
This commit is contained in:
parent
00c0650f96
commit
3a90a01dd4
Notes:
sideshowbarker
2024-07-19 06:15:56 +09:00
Author: https://github.com/Jongy Commit: https://github.com/SerenityOS/serenity/commit/3a90a01dd40 Pull-request: https://github.com/SerenityOS/serenity/pull/2325 Issue: https://github.com/SerenityOS/serenity/issues/1549
1 changed files with 1 additions and 1 deletions
|
@ -450,7 +450,7 @@ Vector<Ext2FS::BlockIndex> Ext2FS::block_list_for_inode_impl(const ext2_inode& e
|
|||
|
||||
auto process_block_array = [&](unsigned array_block_index, auto&& callback) {
|
||||
if (include_block_list_blocks)
|
||||
callback(array_block_index);
|
||||
add_block(array_block_index);
|
||||
unsigned count = min(blocks_remaining, entries_per_block);
|
||||
size_t read_size = count * sizeof(__u32);
|
||||
auto array_block = ByteBuffer::create_uninitialized(read_size);
|
||||
|
|
Loading…
Reference in a new issue