summaryrefslogtreecommitdiff
path: root/ShellPkg/Library/UefiShellLib/UefiShellLib.c
diff options
context:
space:
mode:
authorMichael Kinney <michael.d.kinney@intel.com>2016-09-28 17:33:43 -0700
committerMichael Kinney <michael.d.kinney@intel.com>2016-10-03 15:05:40 -0700
commitc0b7e2b2bfc2748112607bfe83fc99cf48c97b48 (patch)
tree39195b62f7ecce85adc26a7d58fb43d9bbe8c64a /ShellPkg/Library/UefiShellLib/UefiShellLib.c
parent8550b5f0810f306850f9a07ee551099155d89ae0 (diff)
downloadedk2-platforms-c0b7e2b2bfc2748112607bfe83fc99cf48c97b48.tar.xz
ShellPkg/Hexedit: Fix FreePool() ASSERT() when writing disk
The HDiskImageSave() function copies a device path using DuplicateDevicePath() and passes that device path to gBS->LocateDevicePath() that changes the value of the device path pointer. When FreePool() is called with the modified device path pointer, the FreePool() service generates an ASSERT() because the signature for the pool head can not be found. The function HDiskImageRead() immediately above HDiskImageSave() has the correct algorithm that uses an additional local variable called DupDevicePathForFree to preserve the pointer to the allocated buffer so it can be used in the call to FreePool(). Bug: <https://bugzilla.tianocore.org/show_bug.cgi?id=131> Cc: Jaben Carsey <jaben.carsey@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Michael Kinney <michael.d.kinney@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Jaben Carsey <Jaben.carsey@intel.com>
Diffstat (limited to 'ShellPkg/Library/UefiShellLib/UefiShellLib.c')
0 files changed, 0 insertions, 0 deletions