mirror of
https://github.com/RGBCube/serenity
synced 2025-05-15 09:44:58 +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
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