MdeModulePkg: Code logic optimization for Ip4Dxe driver

Move null check before set value to address to avoid null address dereferenced.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: fanwang2 <fan.wang@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17924 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
fanwang2 2015-07-10 09:01:42 +00:00 committed by fanwang2
parent 3fd7bd08f4
commit b1d4218a51
1 changed files with 4 additions and 4 deletions

View File

@ -874,6 +874,10 @@ Ip4FormExtractConfig (
EFI_STRING FormResult;
UINTN Size;
UINTN BufferSize;
if (Progress == NULL || Results == NULL) {
return EFI_INVALID_PARAMETER;
}
Status = EFI_SUCCESS;
IfrFormNvData = NULL;
@ -887,10 +891,6 @@ Ip4FormExtractConfig (
BufferSize = sizeof (IP4_CONFIG2_IFR_NVDATA);
*Progress = Request;
if (Progress == NULL || Results == NULL) {
return EFI_INVALID_PARAMETER;
}
//
// Check Request data in <ConfigHdr>.
//