summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Universal
diff options
context:
space:
mode:
authorJiaxin Wu <jiaxin.wu@intel.com>2016-12-29 15:57:39 +0800
committerJiaxin Wu <jiaxin.wu@intel.com>2017-01-04 08:40:09 +0800
commitd52f9163debb523e06d49ed8a4627a0317bab92c (patch)
treea4bde41ea4ddcb554669fe8f7044ca3bec398289 /MdeModulePkg/Universal
parent32ea56f0a65b80324e3e651432bdf496a6fc55b7 (diff)
downloadedk2-platforms-d52f9163debb523e06d49ed8a4627a0317bab92c.tar.xz
MdeModulePkg/Ip4Dxe: Fix the potential NULL pointer free
Ip4Config2SetDnsServer may cause ASSERT if the invalid DNS server address received. The issue is triggered by the NULL pointer(Tmp) free. Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com>
Diffstat (limited to 'MdeModulePkg/Universal')
-rw-r--r--MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.c b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.c
index 88ead9d269..131b03f771 100644
--- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.c
+++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.c
@@ -1,7 +1,7 @@
/** @file
The implementation of EFI IPv4 Configuration II Protocol.
- Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.<BR>
(C) Copyright 2015-2016 Hewlett Packard Enterprise Development LP<BR>
This program and the accompanying materials
@@ -741,13 +741,17 @@ Ip4Config2SetDnsServerWorker (
//
// The dns server address must be unicast.
//
- FreePool (Tmp);
+ if (Tmp != NULL) {
+ FreePool (Tmp);
+ }
return EFI_INVALID_PARAMETER;
}
for (Index1 = NewIndex + 1; Index1 < NewDnsCount; Index1++) {
if (EFI_IP4_EQUAL (NewDns + NewIndex, NewDns + Index1)) {
- FreePool (Tmp);
+ if (Tmp != NULL) {
+ FreePool (Tmp);
+ }
return EFI_INVALID_PARAMETER;
}
}