diff options
author | Jiaxin Wu <jiaxin.wu@intel.com> | 2017-01-03 11:27:38 +0800 |
---|---|---|
committer | Jiaxin Wu <jiaxin.wu@intel.com> | 2017-01-04 08:40:27 +0800 |
commit | ab50ab6ea159821d780be60759874dcf38835d1b (patch) | |
tree | 5247414ed4bc055ba074f29148bfbc16353ffce5 /NetworkPkg | |
parent | d52f9163debb523e06d49ed8a4627a0317bab92c (diff) | |
download | edk2-platforms-ab50ab6ea159821d780be60759874dcf38835d1b.tar.xz |
NetworkPkg/Ip6Dxe: Fix the potential NULL pointer free
Ip6ConfigSetDnsServer 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 'NetworkPkg')
-rw-r--r-- | NetworkPkg/Ip6Dxe/Ip6ConfigImpl.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/NetworkPkg/Ip6Dxe/Ip6ConfigImpl.c b/NetworkPkg/Ip6Dxe/Ip6ConfigImpl.c index 9b6a62e9ec..4e881fd6df 100644 --- a/NetworkPkg/Ip6Dxe/Ip6ConfigImpl.c +++ b/NetworkPkg/Ip6Dxe/Ip6ConfigImpl.c @@ -1,7 +1,7 @@ /** @file
The implementation of EFI IPv6 Configuration Protocol.
- Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
@@ -1366,13 +1366,17 @@ Ip6ConfigSetDnsServer ( //
// 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_IP6_EQUAL (NewDns + NewIndex, NewDns + Index1)) {
- FreePool (Tmp);
+ if (Tmp != NULL) {
+ FreePool (Tmp);
+ }
return EFI_INVALID_PARAMETER;
}
}
|