]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Network/SnpDxe/Nvdata.c
add security check.
[mirror_edk2.git] / MdeModulePkg / Universal / Network / SnpDxe / Nvdata.c
index 9aa02e1a930ac313f9f075cf402c6ccb7f2b86a3..20d5daa25cb2afbb58ac8e4329d11b4ba2e7140f 100644 (file)
@@ -1,8 +1,8 @@
 /** @file\r
-               Implementation of reading and writing operations on the NVRAM device\r
-               attached to a network interface.\r
+       Implementation of reading and writing operations on the NVRAM device\r
+       attached to a network interface.\r
  \r
-Copyright (c) 2004 - 2007, Intel Corporation. <BR> \r
+Copyright (c) 2004 - 2009, Intel Corporation. <BR> \r
 All rights reserved. This program and the accompanying materials are licensed \r
 and made available under the terms and conditions of the BSD License which \r
 accompanies this distribution. The full text of the license may be found at \r
@@ -88,6 +88,8 @@ PxeNvDataRead (
     return EFI_DEVICE_ERROR;\r
   }\r
 \r
+  ASSERT ((Offset + BufferSize) <= sizeof (Db->Data));\r
+\r
   CopyMem (Buffer, Db->Data.Byte + Offset, BufferSize);\r
 \r
   return EFI_SUCCESS;\r