]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Initialize data and correct faulty logic in TcpComponentNameGetControllerName().
authorWu Jiaxin <jiaxin.wu@intel.com>
Wed, 4 Feb 2015 06:43:34 +0000 (06:43 +0000)
committerjiaxinwu <jiaxinwu@Edk2>
Wed, 4 Feb 2015 06:43:34 +0000 (06:43 +0000)
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16743 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Universal/Network/Tcp4Dxe/ComponentName.c

index c9043958b4b7dda3763d74de5d13e2d4c0293531..bb3a39c5b1cdf03941c55a3d8d7ef47613b21062 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   UEFI Component Name(2) protocol implementation for Tcp4Dxe driver.\r
 \r
-Copyright (c) 2005 - 2013, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2005 - 2015, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -256,6 +256,7 @@ UpdateName (
   // Format the child name into the string buffer as:\r
   // TCPv4 (SrcPort=59, DestPort=60, ActiveFlag=TRUE)\r
   //\r
+  ZeroMem (&Tcp4ConfigData, sizeof (Tcp4ConfigData));\r
   Status = Tcp4->GetModeData (Tcp4, NULL, &Tcp4ConfigData, NULL, NULL, NULL);\r
   if (!EFI_ERROR (Status)) {\r
     UnicodeSPrint (HandleName, sizeof (HandleName),\r
@@ -264,7 +265,7 @@ UpdateName (
       Tcp4ConfigData.AccessPoint.RemotePort,\r
       (Tcp4ConfigData.AccessPoint.ActiveFlag ? L"TRUE" : L"FALSE")\r
       );\r
-  } if (Status == EFI_NOT_STARTED) {\r
+  } else if (Status == EFI_NOT_STARTED) {\r
     UnicodeSPrint (\r
       HandleName,\r
       sizeof (HandleName),\r