diff --git a/Ext4Pkg/Ext4Dxe/File.c b/Ext4Pkg/Ext4Dxe/File.c index 2d76e18180..7939fcd3ac 100644 --- a/Ext4Pkg/Ext4Dxe/File.c +++ b/Ext4Pkg/Ext4Dxe/File.c @@ -726,7 +726,11 @@ Ext4GetVolumeName ( VolNameLength = StrLen (VolumeName); } else { - VolumeName = AllocateZeroPool (sizeof (CHAR16)); + VolumeName = AllocateZeroPool (sizeof (CHAR16)); + if (VolumeName == NULL) { + return EFI_OUT_OF_RESOURCES; + } + VolNameLength = 0; } @@ -793,7 +797,9 @@ Ext4GetFilesystemInfo ( Info->VolumeSize = MultU64x32 (TotalBlocks, Part->BlockSize); Info->FreeSpace = MultU64x32 (FreeBlocks, Part->BlockSize); - StrCpyS (Info->VolumeLabel, VolNameLength + 1, VolumeName); + Status = StrCpyS (Info->VolumeLabel, VolNameLength + 1, VolumeName); + + ASSERT_EFI_ERROR (Status); FreePool (VolumeName); diff --git a/Ext4Pkg/Ext4Dxe/Inode.c b/Ext4Pkg/Ext4Dxe/Inode.c index 5ccb4d2bfc..2977238d68 100644 --- a/Ext4Pkg/Ext4Dxe/Inode.c +++ b/Ext4Pkg/Ext4Dxe/Inode.c @@ -230,7 +230,7 @@ Ext4AllocateInode ( Inode = AllocateZeroPool (InodeSize); - if (!Inode) { + if (Inode == NULL) { return NULL; }