mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-27 23:09:08 +00:00
Kernel: Don't create a zero-length VLA in Ext2FS block list walk
Found by KUBSAN :^)
This commit is contained in:
parent
d164f89ada
commit
4c0707e56c
Notes:
sideshowbarker
2024-07-18 22:34:37 +09:00
Author: https://github.com/awesomekling
Commit: 4c0707e56c
1 changed files with 2 additions and 0 deletions
|
@ -501,6 +501,8 @@ Vector<Ext2FS::BlockIndex> Ext2FS::block_list_for_inode_impl(const ext2_inode& e
|
|||
if (include_block_list_blocks)
|
||||
add_block(array_block_index);
|
||||
auto count = min(blocks_remaining, entries_per_block);
|
||||
if (!count)
|
||||
return;
|
||||
u32 array[count];
|
||||
auto buffer = UserOrKernelBuffer::for_kernel_buffer((u8*)array);
|
||||
auto result = read_block(array_block_index, &buffer, sizeof(array), 0);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue