mirror of https://github.com/acidanthera/audk.git
ShellPkg/Shell: Avoid potential null pointer deference
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
This commit is contained in:
parent
779cc439e8
commit
15de94cf05
|
@ -1162,6 +1162,12 @@ LocateStartupScript (
|
|||
MapName = ShellInfoObject.NewEfiShellProtocol->GetMapFromDevicePath (&ImageDevicePath);
|
||||
if (MapName != NULL) {
|
||||
StartupScriptPath = StrnCatGrow (&StartupScriptPath, &Size, MapName, 0);
|
||||
if (StartupScriptPath == NULL) {
|
||||
//
|
||||
// Do not locate the startup script in sys path when out of resource.
|
||||
//
|
||||
return NULL;
|
||||
}
|
||||
TempSpot = StrStr (StartupScriptPath, L";");
|
||||
if (TempSpot != NULL) {
|
||||
*TempSpot = CHAR_NULL;
|
||||
|
|
Loading…
Reference in New Issue