audk/MdeModulePkg/Universal/Disk
Paulo Alcantara 11b4463e09 MdeModulePkg/UdfDxe: Fix NULL pointer dereference
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=704

For root directory, the FID (File Identifier Descriptor) pointer is
accessible through PRIVATE_UDF_FILE_DATA.Root, whereas non-root
directory and regular files, their FIDs are accessible through
PRIVATE_UDF_FILE_DATA.File.

In UdfSetPosition(), the FID was retrieved through
PRIVATE_UDF_FILE_DATA.File, hence when calling it with a root directory,
PRIVATE_UDF_FILE_DATA.File.FileIdentifierDescriptor would be NULL and
then dereferenced.

This patch fixes the NULL pointer dereference by calling _FILE() to
transparently return the correct UDF_FILE_INFO * which points to a valid
FID descriptor of a specific file.

Cc: Star Zeng <star.zeng@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Steven Shi <steven.shi@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Reported-by: Steven Shi <steven.shi@intel.com>
Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
2017-09-15 09:38:05 +08:00
..
CdExpressPei MdeModulePkg/CdExpressPei: Use PcdRecoveryFileName PCD. 2016-10-12 09:15:23 +08:00
DiskIoDxe MdeModulePkg DiskIoDxe: Media status check not be done at DiskIo level 2016-03-29 13:39:13 +08:00
PartitionDxe MdeModulePkg/PartitionDxe: remove always false comparison 2017-09-12 12:12:31 +02:00
RamDiskDxe MdeModulePkg/RamDiskDxe: fix C string literal catenation in info messages 2017-03-20 11:06:36 +01:00
UdfDxe MdeModulePkg/UdfDxe: Fix NULL pointer dereference 2017-09-15 09:38:05 +08:00
UnicodeCollation/EnglishDxe MdeModulePkg: Convert all .uni files to utf-8 2015-12-15 04:56:23 +00:00