]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Add more check for the code to make it more safely.
authorEric Dong <eric.dong@intel.com>
Thu, 18 Sep 2014 08:45:26 +0000 (08:45 +0000)
committerydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 18 Sep 2014 08:45:26 +0000 (08:45 +0000)
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Siyuan Fu <siyuan.fu@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16129 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Universal/Network/MnpDxe/ComponentName.c
MdeModulePkg/Universal/Network/SnpDxe/ComponentName.c

index 25a7f88482ad38206a7e9fd8a83b6951a66bb3a8..b6f96087ede91dc2b3603d5e0b35774aebd8f5f1 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   UEFI Component Name(2) protocol implementation for MnpDxe driver.\r
 \r
 /** @file\r
   UEFI Component Name(2) protocol implementation for MnpDxe driver.\r
 \r
-Copyright (c) 2005 - 2012, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2005 - 2014, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions\r
 of the BSD License which accompanies this distribution.  The full\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions\r
 of the BSD License which accompanies this distribution.  The full\r
@@ -153,6 +153,7 @@ UpdateName (
                   SnpModeData.CurrentAddress.Addr[Index]\r
                   );\r
     }\r
                   SnpModeData.CurrentAddress.Addr[Index]\r
                   );\r
     }\r
+    ASSERT (OffSet > 0);\r
     //\r
     // Remove the last '-'\r
     //\r
     //\r
     // Remove the last '-'\r
     //\r
index 0b12359f14b60c99329579edbcffb3a33bc542a6..d8b818401888d54186bdffc99f73ce3ab8dc7fe3 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
     UEFI Component Name(2) protocol implementation for SnpDxe driver.\r
 \r
 /** @file\r
     UEFI Component Name(2) protocol implementation for SnpDxe driver.\r
 \r
-Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR>\r
 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
 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
@@ -271,6 +271,7 @@ UpdateName (
                 Snp->Mode->CurrentAddress.Addr[Index]\r
                 );\r
   }\r
                 Snp->Mode->CurrentAddress.Addr[Index]\r
                 );\r
   }\r
+  ASSERT (OffSet > 0);\r
   //\r
   // Remove the last '-'\r
   //\r
   //\r
   // Remove the last '-'\r
   //\r