Fix memory out of band access in AsmFxSave() and AsmFxRestore().
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
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
/*++
|
/*++
|
||||||
|
|
||||||
Copyright (c) 2004 - 2006, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.<BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
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
|
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()
|
// 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);
|
InternalX86FxRestore (Buffer);
|
||||||
}
|
}
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/*++
|
/*++
|
||||||
|
|
||||||
Copyright (c) 2004 - 2006, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.<BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
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
|
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()
|
// 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;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user