]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EmulatorPkg/Unix/Host/BerkeleyPacketFilter.c
EmulatorPkg: Add -D DISABLE_NEW_DEPRECATED_INTERFACES
[mirror_edk2.git] / EmulatorPkg / Unix / Host / BerkeleyPacketFilter.c
index e318a90740c5c8fc625b7122f3cbf0f0982bbea5..8d0eb0d197b011932b65a1655ef3a8e90e1e3f5a 100644 (file)
@@ -4,7 +4,7 @@
 \r
  Tested on Mac OS X.\r
 \r
-Copyright (c) 2004 - 2009, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2019, Intel Corporation. All rights reserved.<BR>\r
 Portitions copyright (c) 2011, Apple Inc. All rights reserved.\r
 \r
 SPDX-License-Identifier: BSD-2-Clause-Patent\r
@@ -242,7 +242,7 @@ EmuSnpStart (
     //\r
     // Associate our interface with this BPF file descriptor.\r
     //\r
-    AsciiStrCpy (BoundIf.ifr_name, Private->InterfaceName);\r
+    AsciiStrCpyS (BoundIf.ifr_name, sizeof (BoundIf.ifr_name), Private->InterfaceName);\r
     if (ioctl (Private->BpfFd, BIOCSETIF, &BoundIf) < 0) {\r
       goto DeviceErrorExit;\r
     }\r
@@ -1016,7 +1016,11 @@ GetInterfaceMacAddr (
     goto Exit;\r
   }\r
 \r
-  UnicodeStrToAsciiStr (Private->Thunk->ConfigString, Private->InterfaceName);\r
+  UnicodeStrToAsciiStrS (\r
+    Private->Thunk->ConfigString,\r
+    Private->InterfaceName,\r
+    StrSize (Private->Thunk->ConfigString)\r
+    );\r
 \r
   Status = EFI_NOT_FOUND;\r
   If = IfAddrs;\r