mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-22 05:04:24 +02:00
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);
|
MapName = ShellInfoObject.NewEfiShellProtocol->GetMapFromDevicePath (&ImageDevicePath);
|
||||||
if (MapName != NULL) {
|
if (MapName != NULL) {
|
||||||
StartupScriptPath = StrnCatGrow (&StartupScriptPath, &Size, MapName, 0);
|
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";");
|
TempSpot = StrStr (StartupScriptPath, L";");
|
||||||
if (TempSpot != NULL) {
|
if (TempSpot != NULL) {
|
||||||
*TempSpot = CHAR_NULL;
|
*TempSpot = CHAR_NULL;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user