From b5f8b5b03dde02d13cedc87d42bccd5c822e2801 Mon Sep 17 00:00:00 2001 From: Eric Dong Date: Thu, 26 Jun 2014 03:16:27 +0000 Subject: Refine code to make it more safely. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Eric Dong Reviewed-by: Liming Gao git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15595 6f19259b-4bc3-4df7-8a09-765794883524 --- .../Compatibility/FrameworkHiiOnUefiHiiThunk/HiiDatabase.c | 3 ++- .../Compatibility/FrameworkHiiOnUefiHiiThunk/UefiIfrParser.c | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'EdkCompatibilityPkg/Compatibility') diff --git a/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/HiiDatabase.c b/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/HiiDatabase.c index 5453c5a754..386ff327f8 100644 --- a/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/HiiDatabase.c +++ b/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/HiiDatabase.c @@ -2,7 +2,7 @@ Framework to UEFI 2.1 HII Thunk. The driver consume UEFI HII protocols to produce a Framework HII protocol. -Copyright (c) 2008 - 2011, Intel Corporation. All rights reserved.
+Copyright (c) 2008 - 2014, Intel Corporation. All rights reserved.
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 @@ -158,6 +158,7 @@ InitializeHiiDatabase ( Status = ListPackageLists (EFI_HII_PACKAGE_STRINGS, NULL, &BufferLength, &Buffer); if (Status == EFI_SUCCESS) { + ASSERT (Buffer != NULL); for (Index = 0; Index < BufferLength / sizeof (EFI_HII_HANDLE); Index++) { ThunkContext = CreateThunkContextForUefiHiiHandle (Buffer[Index]); ASSERT (ThunkContext!= NULL); diff --git a/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/UefiIfrParser.c b/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/UefiIfrParser.c index 4c4411fabb..07b99fbecb 100644 --- a/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/UefiIfrParser.c +++ b/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/UefiIfrParser.c @@ -1,7 +1,7 @@ /** @file Parser for IFR binary encoding. -Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved.
+Copyright (c) 2008 - 2014, Intel Corporation. All rights reserved.
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 @@ -1024,10 +1024,12 @@ ParseOpCodes ( case EFI_IFR_FORM_OP: case EFI_IFR_FORM_MAP_OP: + ASSERT (CurrentForm != NULL); ImageId = &CurrentForm->ImageId; break; case EFI_IFR_ONE_OF_OPTION_OP: + ASSERT (CurrentOption != NULL); ImageId = &CurrentOption->ImageId; break; -- cgit v1.2.3