audk/ShellPkg/Library/UefiShellCommandLib
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
..
ConsistMapping.c ShellPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:25 -07:00
UefiShellCommandLib.c ShellPkg/CommandLib: avoid NULL derefence and memory leak 2019-09-03 15:09:50 +08:00
UefiShellCommandLib.h ShellPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:25 -07:00
UefiShellCommandLib.inf ShellPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:25 -07:00