update the QueryVariableInfo interface to first determine if the pointer checked is pointing to a memory address inside Variable area.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7969 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
eric_tian 2009-03-27 05:05:48 +00:00
parent bd37f9718f
commit 6f90dfbc0d
1 changed files with 1 additions and 1 deletions

View File

@ -1716,7 +1716,7 @@ RuntimeServiceQueryVariableInfo (
//
// Now walk through the related variable store.
//
while (IsValidVariableHeader (Variable) && (Variable < GetEndPointer (VariableStoreHeader))) {
while ((Variable < GetEndPointer (VariableStoreHeader)) && IsValidVariableHeader (Variable)) {
NextVariable = GetNextVariablePtr (Variable);
VariableSize = (UINT64) (UINTN) NextVariable - (UINT64) (UINTN) Variable;