From 205627bfb5360f608716f1e4708d17037dd60bd2 Mon Sep 17 00:00:00 2001 From: lgao4 Date: Tue, 30 Oct 2012 08:36:02 +0000 Subject: Fix memory out of band access in AsmFxSave() and AsmFxRestore(). Signed-off-by: Liming Gao Reviewed-by: Feng Tian git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13895 6f19259b-4bc3-4df7-8a09-765794883524 --- .../Foundation/Library/EdkIIGlueLib/Library/BaseLib/X86FxRestore.c | 4 ++-- .../Foundation/Library/EdkIIGlueLib/Library/BaseLib/X86FxSave.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'EdkCompatibilityPkg') diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X86FxRestore.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X86FxRestore.c index 50f7c19450..cf3be0a0ff 100644 --- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X86FxRestore.c +++ b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X86FxRestore.c @@ -1,6 +1,6 @@ /*++ -Copyright (c) 2004 - 2006, Intel Corporation. All rights reserved.
+Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -48,7 +48,7 @@ AsmFxRestore ( // // Check the flag recorded by AsmFxSave() // - ASSERT (*(UINT32 *) (&Buffer[sizeof (IA32_FX_BUFFER) - 4]) == 0xAA5555AA); + ASSERT (*(UINT32 *) (&Buffer->Buffer[sizeof (Buffer->Buffer) - 4]) == 0xAA5555AA); InternalX86FxRestore (Buffer); } diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X86FxSave.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X86FxSave.c index d584d258ec..b472981081 100644 --- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X86FxSave.c +++ b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X86FxSave.c @@ -1,6 +1,6 @@ /*++ -Copyright (c) 2004 - 2006, Intel Corporation. All rights reserved.
+Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -49,5 +49,5 @@ AsmFxSave ( // // Mark one flag at end of Buffer, it will be check by AsmFxRestor() // - *(UINT32 *) (&Buffer[sizeof (IA32_FX_BUFFER) - 4]) = 0xAA5555AA; + *(UINT32 *) (&Buffer->Buffer[sizeof (Buffer->Buffer) - 4]) = 0xAA5555AA; } -- cgit v1.2.3