From 7c950c2d0147b93adcca0c1cc10e9a0be09de1af Mon Sep 17 00:00:00 2001 From: Brian Gianforcaro Date: Sun, 21 Feb 2021 02:14:43 -0800 Subject: [PATCH] Kernel: Use ByteBuffer::zero_fill() instead of raw memset in Ext2 There was a typo in one of the memsets, use the type safe wrapper instead. Fix EXt --- Kernel/FileSystem/Ext2FileSystem.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Kernel/FileSystem/Ext2FileSystem.cpp b/Kernel/FileSystem/Ext2FileSystem.cpp index de5e276968..483f4ddc1f 100644 --- a/Kernel/FileSystem/Ext2FileSystem.cpp +++ b/Kernel/FileSystem/Ext2FileSystem.cpp @@ -343,7 +343,7 @@ KResult Ext2FS::write_block_list_for_inode(InodeIndex inode_index, ext2_inode& e auto dind_block_contents = ByteBuffer::create_uninitialized(block_size()); if (dind_block_new) { - memset(dind_block_contents.data(), 0, dind_block_contents.size()); + dind_block_contents.zero_fill(); dind_block_dirty = true; } else { auto buffer = UserOrKernelBuffer::for_kernel_buffer(dind_block_contents.data()); @@ -370,7 +370,7 @@ KResult Ext2FS::write_block_list_for_inode(InodeIndex inode_index, ext2_inode& e auto ind_block_contents = ByteBuffer::create_uninitialized(block_size()); if (ind_block_new) { - memset(ind_block_contents.data(), 0, dind_block_contents.size()); + ind_block_contents.zero_fill(); ind_block_dirty = true; } else { auto buffer = UserOrKernelBuffer::for_kernel_buffer(ind_block_contents.data());