From 131fd40ffc34bd0b3b4eca6a66378f48d1b25279 Mon Sep 17 00:00:00 2001 From: Laszlo Ersek Date: Sat, 9 Sep 2017 23:11:41 +0200 Subject: [PATCH] MdeModulePkg/UdfDxe: don't return unset Status if INLINE_DATA req succeeds Ard reports that clang-3.8 correctly flags the following issue in the ReadFile() function: If "RecordingFlags" is INLINE_DATA, then there are three paths through the code where we mean to return success, but forget to set Status accordingly: (1) when "ReadFileInfo->Flags" is READ_FILE_GET_FILESIZE, or (2) when "ReadFileInfo->Flags" is READ_FILE_ALLOCATE_AND_READ and AllocatePool() succeeds, or (3) when "ReadFileInfo->Flags" is READ_FILE_SEEK_AND_READ. Set "Status" to EFI_SUCCESS when we are done processing the INLINE_DATA request, i.e., when we reach the corresponding "break" statament under the INLINE_DATA case label. Cc: Ard Biesheuvel Cc: Eric Dong Cc: Paulo Alcantara Cc: Ruiyu Ni Cc: Star Zeng Reported-by: Ard Biesheuvel Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Laszlo Ersek Reviewed-by: Star Zeng Reviewed-by: Paulo Alcantara Reviewed-by: Ard Biesheuvel --- MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c b/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c index 842c7f8f09..7286265373 100644 --- a/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c +++ b/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c @@ -967,7 +967,9 @@ ReadFile ( return EFI_INVALID_PARAMETER; } + Status = EFI_SUCCESS; break; + case LONG_ADS_SEQUENCE: case SHORT_ADS_SEQUENCE: // -- 2.39.2