SecurityPkg OpalPasswordDxe: Check the pointer before use it.
Check the pointer before use it to make the code more safely. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Eric Dong <eric.dong@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
This commit is contained in:
parent
3626c583e5
commit
b4ddf0eb49
|
@ -435,12 +435,12 @@ GetDiskNameStringId(
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
DriverCallback(
|
DriverCallback(
|
||||||
CONST EFI_HII_CONFIG_ACCESS_PROTOCOL* This,
|
CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,
|
||||||
EFI_BROWSER_ACTION Action,
|
EFI_BROWSER_ACTION Action,
|
||||||
EFI_QUESTION_ID QuestionId,
|
EFI_QUESTION_ID QuestionId,
|
||||||
UINT8 Type,
|
UINT8 Type,
|
||||||
EFI_IFR_TYPE_VALUE* Value,
|
EFI_IFR_TYPE_VALUE *Value,
|
||||||
EFI_BROWSER_ACTION_REQUEST* ActionRequest
|
EFI_BROWSER_ACTION_REQUEST *ActionRequest
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
HII_KEY HiiKey;
|
HII_KEY HiiKey;
|
||||||
|
@ -448,6 +448,8 @@ DriverCallback(
|
||||||
|
|
||||||
if (ActionRequest != NULL) {
|
if (ActionRequest != NULL) {
|
||||||
*ActionRequest = EFI_BROWSER_ACTION_REQUEST_NONE;
|
*ActionRequest = EFI_BROWSER_ACTION_REQUEST_NONE;
|
||||||
|
} else {
|
||||||
|
return EFI_INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -644,14 +646,13 @@ HiiPsidRevert(
|
||||||
|
|
||||||
UnicodeStrToAsciiStr(gHiiConfiguration.Psid, (CHAR8*)Psid.Psid);
|
UnicodeStrToAsciiStr(gHiiConfiguration.Psid, (CHAR8*)Psid.Psid);
|
||||||
|
|
||||||
OpalDisk = HiiGetOpalDiskCB(gHiiConfiguration.SelectedDiskIndex);
|
OpalDisk = HiiGetOpalDiskCB (gHiiConfiguration.SelectedDiskIndex);
|
||||||
|
|
||||||
ZeroMem(&Session, sizeof(Session));
|
|
||||||
Session.Sscp = OpalDisk->Sscp;
|
|
||||||
Session.MediaId = OpalDisk->MediaId;
|
|
||||||
Session.OpalBaseComId = OpalDisk->OpalBaseComId;
|
|
||||||
|
|
||||||
if (OpalDisk != NULL) {
|
if (OpalDisk != NULL) {
|
||||||
|
ZeroMem(&Session, sizeof(Session));
|
||||||
|
Session.Sscp = OpalDisk->Sscp;
|
||||||
|
Session.MediaId = OpalDisk->MediaId;
|
||||||
|
Session.OpalBaseComId = OpalDisk->OpalBaseComId;
|
||||||
|
|
||||||
Ret = OpalSupportPsidRevert(&Session, Psid.Psid, (UINT32)sizeof(Psid.Psid), OpalDisk->OpalDevicePath);
|
Ret = OpalSupportPsidRevert(&Session, Psid.Psid, (UINT32)sizeof(Psid.Psid), OpalDisk->OpalDevicePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue