]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EmulatorPkg/Unix/Host/BerkeleyPacketFilter.c
EmulatorPkg/Unix: Fix various typos
[mirror_edk2.git] / EmulatorPkg / Unix / Host / BerkeleyPacketFilter.c
index 42103e100a43c28a165e89e54df1df38af8526bb..441f1e8d0afe32759f56d9e7fd69da6f2b1a5331 100644 (file)
@@ -4,16 +4,10 @@
 \r
  Tested on Mac OS X.\r
 \r
-Copyright (c) 2004 - 2009, Intel Corporation. All rights reserved.<BR>\r
-Portitions copyright (c) 2011, Apple Inc. All rights reserved.\r
+Copyright (c) 2004 - 2019, Intel Corporation. All rights reserved.<BR>\r
+Portions copyright (c) 2011, Apple Inc. All rights reserved.\r
 \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
-http://opensource.org/licenses/bsd-license.php\r
-\r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
 \r
@@ -222,6 +216,7 @@ EmuSnpStart (
   }\r
 \r
   Status = EFI_SUCCESS;\r
+  Private->ReadBuffer = NULL;\r
   if (Private->BpfFd == 0) {\r
     Status = OpenBpfFileDescriptor (Private, &Private->BpfFd);\r
     if (EFI_ERROR (Status)) {\r
@@ -248,7 +243,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
@@ -772,10 +767,6 @@ EmuSnpGetStatus (
 \r
   Private = EMU_SNP_PRIVATE_DATA_FROM_THIS (This);\r
 \r
-  if (TxBuf != NULL) {\r
-    *((UINT8 **)TxBuf) =  (UINT8 *)1;\r
-  }\r
-\r
   if ( InterruptStatus != NULL ) {\r
     *InterruptStatus = EFI_SIMPLE_NETWORK_TRANSMIT_INTERRUPT;\r
   }\r
@@ -1022,7 +1013,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