Branch: refs/heads/master
  Home:   https://github.com/tianocore/edk2
  Commit: 8b8e91584555b6193f2099a36502763b47501533
      
https://github.com/tianocore/edk2/commit/8b8e91584555b6193f2099a36502763b47501533
  Author: Heinrich Schuchardt <xypron.g...@gmx.de>
  Date:   2019-09-03 (Tue, 03 Sep 2019)

  Changed paths:
    M ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c

  Log Message:
  -----------
  ShellPkg/CommandLib: avoid NULL derefence and memory leak

Since TianoCore EDK2 commit d65f2cea36d1 ("ShellPkg/CommandLib: Locate
proper UnicodeCollation instance") in edk2 the UEFI Shell crashes if EFI
variable PlatformLang is not defined due to dereferencing gUnicodeCollation
gUnicodeCollation (= NULL) in ShellCommandRegisterCommandName().

Furthermore CommandInit() is leaking PlatformLang if
gUnicodeCollation != NULL.

Close the memory leak and use the first UnicodeCollation instance if
PlatfomLang is not defined.

Fixes: d65f2cea36d1 ("ShellPkg/CommandLib: Locate proper UnicodeCollation
instance")
Signed-off-by: Heinrich Schuchardt <xypron.g...@gmx.de>
Reviewed-by: Zhichao Gao <zhichao....@intel.com>
Reviewed-by: Jaben Carsey <jaben.car...@intel.com>




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

Reply via email to