audk/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit
Laszlo Ersek d5e35fddec ShellPkg/UefiShellDebug1CommandsLib: fix ShellCloseFile() call
In the FileBufferSave() function, we invoke ShellCloseFile() if "Directory
Can Not Be Saved".

The ShellCloseFile() function takes a (SHELL_FILE_HANDLE*) parameter
called "FileHandle", and correctly passes the de-referenced (*FileHandle)
to EFI_SHELL_CLOSE_FILE, which takes a SHELL_FILE_HANDLE.

However, FileBufferSave() passes SHELL_FILE_HANDLE to ShellCloseFile(),
not the expected (SHELL_FILE_HANDLE*). Correct it.

This fixes an actual bug that has remained hidden for two reasons:

- pointer-to-VOID converts from/to any pointer-to-object type silently,
- the bug is on an error path which has likely never fired in practice.

Cc: Jaben Carsey <jaben.carsey@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Zhichao Gao <zhichao.gao@intel.com>
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
2019-10-09 09:40:10 +02:00
..
Edit.c ShellPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:25 -07:00
FileBuffer.c ShellPkg/UefiShellDebug1CommandsLib: fix ShellCloseFile() call 2019-10-09 09:40:10 +02:00
FileBuffer.h ShellPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:25 -07:00
MainTextEditor.c ShellPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:25 -07:00
MainTextEditor.h ShellPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:25 -07:00
Misc.c ShellPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:25 -07:00
Misc.h ShellPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:25 -07:00
TextEditStrings.uni ShellPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:25 -07:00
TextEditor.h ShellPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:25 -07:00
TextEditorTypes.h ShellPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:25 -07:00