Skip to content

Commit c8ae30a

Browse files
Pavel Naberezhnevstokescat
authored andcommitted
Replaced ASSERT() with explicit error handling
During fuzz testing, we encountered an ASSERT() condition being triggered. Changes: - Replaced ASSERT() with explicit condition check - Returns EFI_DEVICE_ERROR on failure case Signed-off-by: Pavel Naberezhnev <[email protected]>
1 parent c809241 commit c8ae30a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Ext4Pkg/Ext4Dxe/File.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,9 @@ Ext4ReadFile (
498498
File = EXT4_FILE_FROM_THIS (This);
499499
Partition = File->Partition;
500500

501-
ASSERT (Ext4FileIsOpenable (File));
501+
if (!Ext4FileIsOpenable (File)) {
502+
return EFI_DEVICE_ERROR;
503+
}
502504

503505
if (Ext4FileIsReg (File)) {
504506
Status = Ext4Read (Partition, File, Buffer, File->Position, BufferSize);

0 commit comments

Comments
 (0)