summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg
diff options
context:
space:
mode:
authorLaszlo Ersek <lersek@redhat.com>2017-09-09 23:11:41 +0200
committerLaszlo Ersek <lersek@redhat.com>2017-09-12 12:12:24 +0200
commit131fd40ffc34bd0b3b4eca6a66378f48d1b25279 (patch)
tree36e2700eb361b3c42473f7f1367ed902feee104b /MdeModulePkg
parenta3240c63ec33b704865618aa18eebe64a33a2dba (diff)
downloadedk2-131fd40ffc34bd0b3b4eca6a66378f48d1b25279.tar.gz
edk2-131fd40ffc34bd0b3b4eca6a66378f48d1b25279.tar.bz2
edk2-131fd40ffc34bd0b3b4eca6a66378f48d1b25279.zip
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 <ard.biesheuvel@linaro.org> Cc: Eric Dong <eric.dong@intel.com> Cc: Paulo Alcantara <pcacjr@zytor.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Star Zeng <star.zeng@intel.com> Reported-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Paulo Alcantara <pcacjr@zytor.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Diffstat (limited to 'MdeModulePkg')
-rw-r--r--MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c2
1 files changed, 2 insertions, 0 deletions
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:
//