]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Fix memory out of band access in AsmFxSave() and AsmFxRestore().
authorlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 30 Oct 2012 08:36:02 +0000 (08:36 +0000)
committerlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 30 Oct 2012 08:36:02 +0000 (08:36 +0000)
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13895 6f19259b-4bc3-4df7-8a09-765794883524

EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X86FxRestore.c
EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X86FxSave.c

index 50f7c194508e226a1d1c1c03102bb7d6e1c02e7a..cf3be0a0ff3bfac122d642d4093ebc20d0494591 100644 (file)
@@ -1,6 +1,6 @@
 /*++\r
 \r
-Copyright (c) 2004 - 2006, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2012, 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
@@ -48,7 +48,7 @@ AsmFxRestore (
   //\r
   // Check the flag recorded by AsmFxSave()\r
   //\r
-  ASSERT (*(UINT32 *) (&Buffer[sizeof (IA32_FX_BUFFER) - 4]) == 0xAA5555AA);\r
+  ASSERT (*(UINT32 *) (&Buffer->Buffer[sizeof (Buffer->Buffer) - 4]) == 0xAA5555AA);\r
 \r
   InternalX86FxRestore (Buffer);\r
 }\r
index d584d258ec48c48b7d247d39cd1873abb6929535..b472981081f008b35b39583e64d443c5e6f98f70 100644 (file)
@@ -1,6 +1,6 @@
 /*++\r
 \r
-Copyright (c) 2004 - 2006, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2012, 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
@@ -49,5 +49,5 @@ AsmFxSave (
   //\r
   // Mark one flag at end of Buffer, it will be check by AsmFxRestor()\r
   //\r
-  *(UINT32 *) (&Buffer[sizeof (IA32_FX_BUFFER) - 4]) = 0xAA5555AA;\r
+  *(UINT32 *) (&Buffer->Buffer[sizeof (Buffer->Buffer) - 4]) = 0xAA5555AA;\r
 }\r