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>
MapName = ShellInfoObject.NewEfiShellProtocol->GetMapFromDevicePath (&ImageDevicePath);\r
if (MapName != NULL) { \r
StartupScriptPath = StrnCatGrow (&StartupScriptPath, &Size, MapName, 0);\r
+ if (StartupScriptPath == NULL) {\r
+ //\r
+ // Do not locate the startup script in sys path when out of resource.\r
+ //\r
+ return NULL;\r
+ }\r
TempSpot = StrStr (StartupScriptPath, L";");\r
if (TempSpot != NULL) {\r
*TempSpot = CHAR_NULL;\r