]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ShellPkg/hexedit: Fix a read-after-free bug
authorRuiyu Ni <ruiyu.ni@intel.com>
Wed, 7 Feb 2018 16:05:10 +0000 (00:05 +0800)
committerRuiyu Ni <ruiyu.ni@intel.com>
Fri, 9 Feb 2018 04:24:54 +0000 (12:24 +0800)
HDiskImageSetDiskNameOffsetSize() and HFileImageSetFileName()
may be called using the current disk name or file name.
When this happens, today's implementation firstly frees the memory
and then accesses the just-freed memory.
The patch fixes this issue by doing nothing when the disk or file
name is the current one.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>

No differences found