Pointer "Buffer" is returned by function HiiGetFormSetFromHiiHandle, when the function HiiGetFormSetFromHiiHandle return success, the "Buffer" can not be NULL, so we add the ASSET codes.
Cc: Eric Dong <[email protected]> Cc: Hao Wu <[email protected]> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <[email protected]> --- MdeModulePkg/Application/UiApp/FrontPageCustomizedUiSupport.c | 1 + .../BootMaintenanceManagerCustomizedUiSupport.c | 1 + MdeModulePkg/Library/DeviceManagerUiLib/DeviceManager.c | 3 ++- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/MdeModulePkg/Application/UiApp/FrontPageCustomizedUiSupport.c b/MdeModulePkg/Application/UiApp/FrontPageCustomizedUiSupport.c index 93f6e4e..5a2762f 100644 --- a/MdeModulePkg/Application/UiApp/FrontPageCustomizedUiSupport.c +++ b/MdeModulePkg/Application/UiApp/FrontPageCustomizedUiSupport.c @@ -519,10 +519,11 @@ RequiredDriver ( Status = HiiGetFormSetFromHiiHandle(HiiHandle, &Buffer,&BufferSize); if (EFI_ERROR (Status)) { return FALSE; } + ASSERT (Buffer != NULL); RetVal = FALSE; TempSize = 0; Ptr = (UINT8 *) Buffer; while(TempSize < BufferSize) { diff --git a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManagerCustomizedUiSupport.c b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManagerCustomizedUiSupport.c index b25bc67..c8978af 100644 --- a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManagerCustomizedUiSupport.c +++ b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManagerCustomizedUiSupport.c @@ -316,10 +316,11 @@ IsRequiredDriver ( Status = HiiGetFormSetFromHiiHandle(HiiHandle, &Buffer,&BufferSize); if (EFI_ERROR (Status)) { return FALSE; } + ASSERT (Buffer != NULL); RetVal = FALSE; TempSize = 0; Ptr = (UINT8 *) Buffer; while(TempSize < BufferSize) { diff --git a/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManager.c b/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManager.c index 0de4e3c..ee8b4fb 100644 --- a/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManager.c +++ b/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManager.c @@ -1,9 +1,9 @@ /** @file The device manager reference implementation -Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.<BR> +Copyright (c) 2004 - 2016, Intel Corporation. All rights reserved.<BR> This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php @@ -574,10 +574,11 @@ CreateDeviceManagerForm( for (Index = 0; HiiHandles[Index] != NULL; Index++) { Status = HiiGetFormSetFromHiiHandle(HiiHandles[Index], &Buffer,&BufferSize); if (EFI_ERROR (Status)){ continue; } + ASSERT (Buffer != NULL); Ptr = (UINT8 *)Buffer; while(TempSize < BufferSize) { TempSize += ((EFI_IFR_OP_HEADER *) Ptr)->Length; if (((EFI_IFR_OP_HEADER *) Ptr)->Length <= OFFSET_OF (EFI_IFR_FORM_SET, Flags)){ Ptr += ((EFI_IFR_OP_HEADER *) Ptr)->Length; -- 1.9.5.msysgit.1 _______________________________________________ edk2-devel mailing list [email protected] https://lists.01.org/mailman/listinfo/edk2-devel

