diff options
author | Fu Siyuan <siyuan.fu@intel.com> | 2018-06-14 10:30:09 +0800 |
---|---|---|
committer | Fu Siyuan <siyuan.fu@intel.com> | 2018-06-21 08:49:47 +0800 |
commit | 1e0db7b11987d0ec93be7dfe26102a327860fdbd (patch) | |
tree | a78aa0d5ea7984f858b18535a6bbc5c201f0fbd6 /MdeModulePkg/Universal | |
parent | 855abe0204cb932c8059a573a06a59ddc714ca49 (diff) | |
download | edk2-1e0db7b11987d0ec93be7dfe26102a327860fdbd.zip edk2-1e0db7b11987d0ec93be7dfe26102a327860fdbd.tar.gz edk2-1e0db7b11987d0ec93be7dfe26102a327860fdbd.tar.bz2 |
MdeModulePkg/NetworkPkg: Checking for NULL pointer before use.
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sivaraman Nainar <sivaramann@amiindia.co.in>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Diffstat (limited to 'MdeModulePkg/Universal')
-rw-r--r-- | MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c index b5cd7b7..5a9d828 100644 --- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c +++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c @@ -1048,8 +1048,11 @@ Ip4Groups ( // is decreamented each time an address is removed..
//
for (Index = IpInstance->GroupCount; Index > 0 ; Index--) {
- Group = IpInstance->Groups[Index - 1];
-
+ Group = 0;
+ if(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;
|