X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=MdeModulePkg%2FUniversal%2FDisk%2FUdfDxe%2FFileSystemOperations.c;h=14b1deac92af63a3a558b7686ea76f75aba7ce1c;hp=fed3da1fa18a93adc57813189cc63b137bb00202;hb=bfb8c64cbf6a4604b1a69de8e274cce7f0a678dc;hpb=542b03d0a090d10d39da79a881787cbb013f1754 diff --git a/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c b/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c index fed3da1fa1..14b1deac92 100644 --- a/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c +++ b/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c @@ -2145,6 +2145,8 @@ ResolveSymlink ( UINT8 CompressionId; UDF_FILE_INFO PreviousFile; + ZeroMem ((VOID *)File, sizeof (UDF_FILE_INFO)); + // // Symlink files on UDF volumes do not contain so much data other than // Path Components which resolves to real filenames, so it's OK to read in @@ -2288,6 +2290,14 @@ ResolveSymlink ( break; } + // + // Check the content in the file info pointed by File. + // + if ((File->FileEntry == NULL) || (File->FileIdentifierDesc == NULL)) { + Status = EFI_VOLUME_CORRUPTED; + goto Error_Find_File; + } + if (CompareMem ((VOID *)&PreviousFile, (VOID *)Parent, sizeof (UDF_FILE_INFO)) != 0) { CleanupFileInformation (&PreviousFile); @@ -2301,6 +2311,13 @@ ResolveSymlink ( // FreePool (ReadFileInfo.FileData); + // + // Check the content in the resolved file info. + // + if ((File->FileEntry == NULL) || (File->FileIdentifierDesc == NULL)) { + return EFI_VOLUME_CORRUPTED; + } + return EFI_SUCCESS; Error_Find_File: