X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=NetworkPkg%2FDhcp6Dxe%2FComponentName.c;h=ba612156a09f1001807eff58127731d258799848;hb=37a00f1a9dea715d8b2b4f1c760040ab4b305985;hp=c7fd6075df92121eabe7481efdf37c83e8df74a6;hpb=2922e29ad86c1bb7b5e53e65eaf0098d866310d7;p=mirror_edk2.git diff --git a/NetworkPkg/Dhcp6Dxe/ComponentName.c b/NetworkPkg/Dhcp6Dxe/ComponentName.c index c7fd6075df..ba612156a0 100644 --- a/NetworkPkg/Dhcp6Dxe/ComponentName.c +++ b/NetworkPkg/Dhcp6Dxe/ComponentName.c @@ -1,7 +1,7 @@ /** @file UEFI Component Name(2) protocol implementation for Dhcp6 driver. - Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.
+ Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License @@ -259,7 +259,7 @@ UpdateName ( { EFI_STATUS Status; EFI_DHCP6_MODE_DATA Dhcp6ModeData; - CHAR16 HandleName[64]; + CHAR16 *HandleName; if (Dhcp6 == NULL) { return EFI_INVALID_PARAMETER; @@ -279,11 +279,21 @@ UpdateName ( } if (Dhcp6ModeData.Ia == NULL) { - UnicodeSPrint (HandleName, sizeof (HandleName), L"DHCPv6 (No configured IA)"); + HandleName = L"DHCPv6 (No configured IA)"; } else { - StrnCpy (HandleName, mDhcp6ControllerName[Dhcp6ModeData.Ia->State], sizeof (HandleName) / sizeof (CHAR16) - 1); + if (Dhcp6ModeData.Ia->State > Dhcp6Rebinding) { + return EFI_DEVICE_ERROR; + } + HandleName = mDhcp6ControllerName[Dhcp6ModeData.Ia->State]; } - + + if (Dhcp6ModeData.Ia != NULL) { + FreePool (Dhcp6ModeData.Ia); + } + if (Dhcp6ModeData.ClientId != NULL) { + FreePool (Dhcp6ModeData.ClientId); + } + Status = AddUnicodeString2 ( "eng", gDhcp6ComponentName.SupportedLanguages,