audk/ShellPkg
Heinrich Schuchardt 8b8e915845 ShellPkg/CommandLib: avoid NULL derefence and memory leak
Since TianoCore EDK2 commit d65f2cea36 ("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: d65f2cea36 ("ShellPkg/CommandLib: Locate proper UnicodeCollation
instance")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
2019-09-03 15:09:50 +08:00
..
Application ShellPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:25 -07:00
DynamicCommand ShellPkg: Add NetworkPkg/NetworkPkg.dec as the package dependency 2019-05-21 10:35:15 +08:00
Include ShellPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:25 -07:00
Library ShellPkg/CommandLib: avoid NULL derefence and memory leak 2019-09-03 15:09:50 +08:00
ShellPkg.dec ShellPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:25 -07:00
ShellPkg.dsc ShellPkg: Add shell with all commands integrated 2019-08-05 14:18:16 -07:00