public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [Patch] MdeModulePkg: Update IP4 driver to check for NULL pointer before using.
@ 2018-06-27  1:18 Fu Siyuan
  2018-06-28  7:13 ` Wu, Jiaxin
  0 siblings, 1 reply; 2+ messages in thread
From: Fu Siyuan @ 2018-06-27  1:18 UTC (permalink / raw)
  To: edk2-devel; +Cc: Ye Ting, Wu Jiaxin

Cc: Ye Ting <ting.ye@intel.com>
Cc: Wu Jiaxin <jiaxin.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
---
 MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c
index 5a9d828703..6a26143e30 100644
--- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c
+++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c
@@ -1048,11 +1048,8 @@ Ip4Groups (
   // is decreamented each time an address is removed..
   //
   for (Index = IpInstance->GroupCount; Index > 0 ; Index--) {
-    Group = 0;  	
-    if(IpInstance->Groups != NULL) {
-  	  Group = IpInstance->Groups[Index - 1];
-  	}
-  	
+    ASSERT (IpInstance->Groups != NULL);
+    Group = IpInstance->Groups[Index - 1];
     if ((GroupAddress == NULL) || EFI_IP4_EQUAL (&Group, GroupAddress)) {
       if (EFI_ERROR (Ip4LeaveGroup (IpInstance, NTOHL (Group)))) {
         return EFI_DEVICE_ERROR;
-- 
2.13.0.windows.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-06-28  7:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-27  1:18 [Patch] MdeModulePkg: Update IP4 driver to check for NULL pointer before using Fu Siyuan
2018-06-28  7:13 ` Wu, Jiaxin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox