Branch: refs/heads/master
  Home:   https://github.com/tianocore/edk2
  Commit: a8acc12dfd80e4b2770c5912b1dbe1a04ab649d6
      
https://github.com/tianocore/edk2/commit/a8acc12dfd80e4b2770c5912b1dbe1a04ab649d6
  Author: Gerd Hoffmann <kra...@redhat.com>
  Date:   2023-06-02 (Fri, 02 Jun 2023)

  Changed paths:
    M ShellPkg/Library/UefiShellDriver1CommandsLib/Disconnect.c

  Log Message:
  -----------
  ShellPkgDisconnect: zero-initialize handles

In case ShellConvertStringToUint64() fails the Handles are left
uninitialized.  That can for example happen for Handle2 and Handle3 in
case only one parameter was specified on the command line. Which can
trigger the ASSERT() in line 185.

Reproducer: boot ovmf to efi shell in qemu, using q35 machine type, then
try disconnect the sata controller in efi shell.

Fix that by explicitly setting them to NULL in that case.  While being
at it also simplify the logic and avoid pointlessly calling
ShellConvertStringToUint64() in case ParamN is NULL.

Signed-off-by: Gerd Hoffmann <kra...@redhat.com>
Reviewed-by: Zhichao Gao <zhichao....@intel.com>




_______________________________________________
edk2-commits mailing list
edk2-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to