]> git.proxmox.com Git - mirror_edk2.git/blobdiff - NetworkPkg/Application/IpsecConfig/Indexer.c
Append the terminating null character at the end of the string to avoid buffer overflow.
[mirror_edk2.git] / NetworkPkg / Application / IpsecConfig / Indexer.c
index 1762bbeb5898911651d20db8196f9affd3a6e678..9e066b1cb54ed1c21e9396fa6f4e1e9a2b3821ba 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   The implementation of construct ENTRY_INDEXER in IpSecConfig application.\r
 \r
-  Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>\r
 \r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
@@ -234,6 +234,7 @@ ConstructPadIndexer (
       }\r
 \r
       Indexer->PadId.PeerIdValid = TRUE;\r
+      ZeroMem (Indexer->PadId.Id.PeerId, MAX_PEERID_LEN);\r
       StrnCpy ((CHAR16 *) Indexer->PadId.Id.PeerId, ValueStr, ARRAY_SIZE (Indexer->PadId.Id.PeerId) - 1);\r
     }\r
   }\r