mirror_edk2/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit
Michael Kinney c0b7e2b2bf 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>
2016-10-03 15:05:40 -07:00
..
BufferImage.c ShellPkg: Fix calls to SimpleTextOut->SetAttribute to not use reserved bits 2014-07-25 18:46:23 +00:00
BufferImage.h add comments to function declarations and definitions and updated to match coding style document. 2011-04-05 20:55:45 +00:00
Clipboard.c add comments to function declarations and definitions and updated to match coding style document. 2011-04-05 20:55:45 +00:00
Clipboard.h add comments to function declarations and definitions and updated to match coding style document. 2011-04-05 20:55:45 +00:00
DiskImage.c ShellPkg/Hexedit: Fix FreePool() ASSERT() when writing disk 2016-10-03 15:05:40 -07:00
DiskImage.h add comments to function declarations and definitions and updated to match coding style document. 2011-04-05 20:55:45 +00:00
FileImage.c ShellPkg: Fix typos. 2015-02-02 01:51:59 +00:00
FileImage.h add comments to function declarations and definitions and updated to match coding style document. 2011-04-05 20:55:45 +00:00
HexEdit.c ShellPkg: Standardized HP Copyright Message String 2015-02-04 22:25:01 +00:00
HexEditor.h add Edit and HexEdit commands. 2011-03-25 21:15:07 +00:00
HexEditorTypes.h ShellPkg: Fix ARM build errors. 2013-06-11 22:07:03 +00:00
HexeditStrings.uni ShellPkg: Convert all .uni files to utf-8 2015-12-09 23:07:58 +00:00
MainHexEditor.c ShellPkg: Fix ARM build errors. 2013-06-11 22:07:03 +00:00
MainHexEditor.h add comments to function declarations and definitions and updated to match coding style document. 2011-04-05 20:55:45 +00:00
MemImage.c ShellPkg: Fixed build error 'variable set but not used' 2013-05-07 17:57:58 +00:00
MemImage.h add comments to function declarations and definitions and updated to match coding style document. 2011-04-05 20:55:45 +00:00
Misc.c update copyright line format 2011-06-07 08:08:19 +00:00
Misc.h add comments to function declarations and definitions and updated to match coding style document. 2011-04-05 20:55:45 +00:00