]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c
MdeModulePkg: Update IP4 driver to check for NULL pointer before using.
[mirror_edk2.git] / MdeModulePkg / Universal / Network / Ip4Dxe / Ip4Impl.c
index 5a9d8287031ca3498cb4b7ac1f9c7713a8100119..6a26143e307d3e4effe40bc1f190fb0833afd3d0 100644 (file)
@@ -1048,11 +1048,8 @@ Ip4Groups (
   // is decreamented each time an address is removed..\r
   //\r
   for (Index = IpInstance->GroupCount; Index > 0 ; Index--) {\r
-    Group = 0;         \r
-    if(IpInstance->Groups != NULL) {\r
-         Group = IpInstance->Groups[Index - 1];\r
-       }\r
-       \r
+    ASSERT (IpInstance->Groups != NULL);\r
+    Group = IpInstance->Groups[Index - 1];\r
     if ((GroupAddress == NULL) || EFI_IP4_EQUAL (&Group, GroupAddress)) {\r
       if (EFI_ERROR (Ip4LeaveGroup (IpInstance, NTOHL (Group)))) {\r
         return EFI_DEVICE_ERROR;\r