]> git.proxmox.com Git - mirror_edk2.git/blobdiff - NetworkPkg/UefiPxeBcDxe/PxeBcSupport.c
NetworkPkg:Replace unsafe string functions.
[mirror_edk2.git] / NetworkPkg / UefiPxeBcDxe / PxeBcSupport.c
index 88ae7b6a7a145c18097ef3ba9f55a4b8d75eb6bc..36b0665a96b888a9753ffa493d3c1b5d6d34a12e 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Support functions implementation for UefiPxeBc Driver.\r
 \r
-  Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2007 - 2015, 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
@@ -1392,6 +1392,7 @@ PxeBcUintnToAscDecWithFormat (
 \r
   @param[in]  Number         Numeric value to be converted.\r
   @param[in]  Buffer         The pointer to the buffer for ASCII string.\r
+  @param[in]  BufferSize     The maxsize of the buffer.\r
 \r
   @return     Length         The actual length of the ASCII string.\r
 \r
@@ -1399,7 +1400,8 @@ PxeBcUintnToAscDecWithFormat (
 UINTN\r
 PxeBcUintnToAscDec (\r
   IN UINTN               Number,\r
-  IN UINT8               *Buffer\r
+  IN UINT8               *Buffer,\r
+  IN UINTN               BufferSize\r
   )\r
 {\r
   UINTN           Index;\r
@@ -1415,7 +1417,7 @@ PxeBcUintnToAscDec (
     Number         = (UINTN) (Number / 10);\r
   } while (Number != 0);\r
 \r
-  AsciiStrCpy ((CHAR8 *) Buffer, &TempStr[Index]);\r
+  AsciiStrCpyS ((CHAR8 *) Buffer, BufferSize, &TempStr[Index]);\r
 \r
   Length = AsciiStrLen ((CHAR8 *) Buffer);\r
 \r