audk/MdeModulePkg/Universal/Disk
Hao Wu 68099b52b0 MdeModulePkg/UdfDxe: Avoid possible use of already-freed data
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=1255

For function ReadFile():

If the line

  Status = GetAedAdsData (
   ...
   );

is reached multiple times during the 'for' loop, freeing the data pointed
by variable 'Data' may potentially lead to variable 'Ad' referencing the
already-freed data.

After calling function GetAllocationDescriptor(), 'Data' and 'Ad' may
point to the same memory (with some possible offset). Hence, this commit
will move the FreePool() call backwards to ensure the data will no longer
be used.

Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Paulo Alcantara <palcantara@suse.de>
Acked-by: Star Zeng <star.zeng@intel.com>
2018-10-23 14:25:04 +08:00
..
CdExpressPei MdeModulePkg: Removing ipf which is no longer supported from edk2. 2018-09-06 15:25:16 +08:00
DiskIoDxe MdeModulePkg: Removing ipf which is no longer supported from edk2. 2018-09-06 15:25:16 +08:00
PartitionDxe MdeModulePkg/PartitionDxe: Add check for underlying device block size 2018-10-23 14:23:09 +08:00
RamDiskDxe MdeModulePkg/RamDiskDxe: replace OpenFileByDevicePath() with UefiLib API 2018-08-16 20:02:50 +02:00
UdfDxe MdeModulePkg/UdfDxe: Avoid possible use of already-freed data 2018-10-23 14:25:04 +08:00
UnicodeCollation/EnglishDxe MdeModulePkg: Removing ipf which is no longer supported from edk2. 2018-09-06 15:25:16 +08:00