mirror of https://github.com/acidanthera/audk.git
Update code to ensure the pointer ‘CurrentName’ in function ‘PerformSingleMappingDisplay’ isn’t null before being processed.
Signed-off-by: Shumin Qiu <shumin.qiu@intel.com> Reviewed-by: Jaben Carsey <Jaben.carsey@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14990 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
6f05676ddd
commit
c6cef63532
|
@ -468,6 +468,9 @@ PerformSingleMappingDisplay(
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Alias = StrnCatGrow(&Alias, 0, MapList, 0);
|
Alias = StrnCatGrow(&Alias, 0, MapList, 0);
|
||||||
|
if (Alias == NULL) {
|
||||||
|
return EFI_OUT_OF_RESOURCES;
|
||||||
|
}
|
||||||
TempSpot = StrStr(Alias, CurrentName);
|
TempSpot = StrStr(Alias, CurrentName);
|
||||||
if (TempSpot != NULL) {
|
if (TempSpot != NULL) {
|
||||||
TempSpot2 = StrStr(TempSpot, L";");
|
TempSpot2 = StrStr(TempSpot, L";");
|
||||||
|
@ -484,6 +487,10 @@ PerformSingleMappingDisplay(
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
CurrentName = NULL;
|
CurrentName = NULL;
|
||||||
|
CurrentName = StrnCatGrow(&CurrentName, 0, L"", 0);
|
||||||
|
if (CurrentName == NULL) {
|
||||||
|
return (EFI_OUT_OF_RESOURCES);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
DevPathString = ConvertDevicePathToText(DevPath, TRUE, FALSE);
|
DevPathString = ConvertDevicePathToText(DevPath, TRUE, FALSE);
|
||||||
if (!SFO) {
|
if (!SFO) {
|
||||||
|
|
Loading…
Reference in New Issue