mirror of https://github.com/acidanthera/audk.git
MdeModulePkg: Refine the code in UiApp
Refine the code in UiApp to prevent the potential risk. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Qiu Shumin <shumin.qiu@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18216 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
fa6c39dbfb
commit
ed5d1532f9
|
@ -258,7 +258,6 @@ FileExplorerCallback (
|
||||||
|
|
||||||
Status = EFI_SUCCESS;
|
Status = EFI_SUCCESS;
|
||||||
Private = FE_CALLBACK_DATA_FROM_THIS (This);
|
Private = FE_CALLBACK_DATA_FROM_THIS (This);
|
||||||
*ActionRequest = EFI_BROWSER_ACTION_REQUEST_NONE;
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Retrieve uncommitted data from Form Browser
|
// Retrieve uncommitted data from Form Browser
|
||||||
|
|
|
@ -524,6 +524,7 @@ Var_UpdateErrorOutOption (
|
||||||
|
|
||||||
@retval EFI_OUT_OF_RESOURCES If not enought memory to complete the operation.
|
@retval EFI_OUT_OF_RESOURCES If not enought memory to complete the operation.
|
||||||
@retval EFI_SUCCESS If function completes successfully.
|
@retval EFI_SUCCESS If function completes successfully.
|
||||||
|
@return Others Errors Return errors from call to gRT->GetVariable.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
|
@ -659,7 +660,10 @@ Var_UpdateDriverOption (
|
||||||
Buffer
|
Buffer
|
||||||
);
|
);
|
||||||
ASSERT_EFI_ERROR (Status);
|
ASSERT_EFI_ERROR (Status);
|
||||||
GetEfiGlobalVariable2 (L"DriverOrder", (VOID **) &DriverOrderList, &DriverOrderListSize);
|
Status = GetEfiGlobalVariable2 (L"DriverOrder", (VOID **) &DriverOrderList, &DriverOrderListSize);
|
||||||
|
if (EFI_ERROR (Status) || DriverOrderList == NULL){
|
||||||
|
return Status;
|
||||||
|
}
|
||||||
NewDriverOrderList = AllocateZeroPool (DriverOrderListSize + sizeof (UINT16));
|
NewDriverOrderList = AllocateZeroPool (DriverOrderListSize + sizeof (UINT16));
|
||||||
ASSERT (NewDriverOrderList != NULL);
|
ASSERT (NewDriverOrderList != NULL);
|
||||||
CopyMem (NewDriverOrderList, DriverOrderList, DriverOrderListSize);
|
CopyMem (NewDriverOrderList, DriverOrderList, DriverOrderListSize);
|
||||||
|
@ -700,6 +704,7 @@ Var_UpdateDriverOption (
|
||||||
|
|
||||||
@retval EFI_OUT_OF_RESOURCES If not enought memory to complete the operation.
|
@retval EFI_OUT_OF_RESOURCES If not enought memory to complete the operation.
|
||||||
@retval EFI_SUCCESS If function completes successfully.
|
@retval EFI_SUCCESS If function completes successfully.
|
||||||
|
@return Others Errors Return errors from call to gRT->GetVariable.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
|
@ -824,7 +829,10 @@ Var_UpdateBootOption (
|
||||||
);
|
);
|
||||||
ASSERT_EFI_ERROR (Status);
|
ASSERT_EFI_ERROR (Status);
|
||||||
|
|
||||||
GetEfiGlobalVariable2 (L"BootOrder", (VOID **) &BootOrderList, &BootOrderListSize);
|
Status = GetEfiGlobalVariable2 (L"BootOrder", (VOID **) &BootOrderList, &BootOrderListSize);
|
||||||
|
if (EFI_ERROR (Status) || BootOrderList == NULL){
|
||||||
|
return Status;
|
||||||
|
}
|
||||||
NewBootOrderList = AllocateZeroPool (BootOrderListSize + sizeof (UINT16));
|
NewBootOrderList = AllocateZeroPool (BootOrderListSize + sizeof (UINT16));
|
||||||
ASSERT (NewBootOrderList != NULL);
|
ASSERT (NewBootOrderList != NULL);
|
||||||
CopyMem (NewBootOrderList, BootOrderList, BootOrderListSize);
|
CopyMem (NewBootOrderList, BootOrderList, BootOrderListSize);
|
||||||
|
|
Loading…
Reference in New Issue