mirror of https://github.com/acidanthera/audk.git
The code line where judges if offset exceed the FTW work space boundary, in some special situations where there are so many records, the offset may happen to be just equal to FtwWorkSpaceSize. And then FtwHead will be updated to be outside of work space wrongly, and cause the system to hang in this driver.
Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Guo Dong <guo.dong@intel.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13307 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
5d4f8cf3c9
commit
fe92f438ac
|
@ -2,7 +2,7 @@
|
|||
|
||||
Internal generic functions to operate flash block.
|
||||
|
||||
Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
|
||||
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
|
||||
|
@ -777,7 +777,7 @@ FtwGetLastWriteHeader (
|
|||
//
|
||||
// If Offset exceed the FTW work space boudary, return error.
|
||||
//
|
||||
if (Offset > FtwWorkSpaceSize) {
|
||||
if (Offset >= FtwWorkSpaceSize) {
|
||||
*FtwWriteHeader = FtwHeader;
|
||||
return EFI_ABORTED;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue