]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Nt32Pkg/SnpNt32Dxe/SnpNt32.c
smbiosview - add user input verification.
[mirror_edk2.git] / Nt32Pkg / SnpNt32Dxe / SnpNt32.c
index be9eb78fb5c0066b71691dc241a3b23b63591218..86414696c418e88c5f9379f1a12948dbd61eca5b 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
 \r
-Copyright (c) 2006 - 2009, Intel Corporation\r
-All rights reserved. This program and the accompanying materials\r
+Copyright (c) 2006 - 2010, 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
 http://opensource.org/licenses/bsd-license.php\r
@@ -440,7 +440,7 @@ SNPNT32_INSTANCE_DATA gSnpNt32InstanceTemplate = {
     NET_IFTYPE_ETHERNET,                  //  IfType\r
     FALSE,                                //  MacAddressChangeable\r
     FALSE,                                //  MultipleTxSupported\r
-    FALSE,                                //  MediaPresentSupported\r
+    TRUE,                                 //  MediaPresentSupported\r
     TRUE                                  //  MediaPresent\r
   },\r
   {\r
@@ -995,6 +995,9 @@ SnpNt32Receive (
   SNPNT32_INSTANCE_DATA *Instance;\r
   SNPNT32_GLOBAL_DATA   *GlobalData;\r
   INT32                 ReturnValue;\r
+  UINTN                 BufSize;\r
+  \r
+  BufSize     = *BuffSize;\r
 \r
   Instance    = SNP_NT32_INSTANCE_DATA_FROM_SNP_THIS (This);\r
 \r
@@ -1042,7 +1045,7 @@ SnpNt32Receive (
     *Protocol = NTOHS (*((UINT16 *) (((UINT8 *) Buffer) + 12)));\r
   }\r
 \r
-  return EFI_SUCCESS;\r
+  return (*BuffSize <= BufSize) ? EFI_SUCCESS : EFI_BUFFER_TOO_SMALL; \r
 }\r
 \r
 /**\r