Revision: 17924
          http://sourceforge.net/p/edk2/code/17924
Author:   fanwang2
Date:     2015-07-10 09:01:42 +0000 (Fri, 10 Jul 2015)
Log Message:
-----------
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 <[email protected]>
Reviewed-by: Ye Ting <[email protected]>
Reviewed-by: Jiaxin Wu <[email protected]>

Modified Paths:
--------------
    trunk/edk2/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Nv.c

Modified: trunk/edk2/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Nv.c
===================================================================
--- trunk/edk2/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Nv.c     
2015-07-10 09:00:33 UTC (rev 17923)
+++ trunk/edk2/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Nv.c     
2015-07-10 09:01:42 UTC (rev 17924)
@@ -874,6 +874,10 @@
   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 @@
   BufferSize         = sizeof (IP4_CONFIG2_IFR_NVDATA);
   *Progress          = Request;
   
-  if (Progress == NULL || Results == NULL) {
-    return EFI_INVALID_PARAMETER;
-  }
-  
   //
   // Check Request data in <ConfigHdr>.
   //


------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to