Adjust code to fix potential array out-bound issues.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7502 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
qhuang8
2009-02-11 07:05:43 +00:00
parent 51195fbe8c
commit 96a5ac5b0d
4 changed files with 19 additions and 6 deletions

View File

@ -48,7 +48,9 @@ VariableIndexTableUpdate (
IN VARIABLE_HEADER *Variable
)
{
IndexTable->Index[IndexTable->Length++] = (UINT16) (UINTN) Variable;
if (IndexTable->Length < VARIABLE_INDEX_TABLE_VOLUME) {
IndexTable->Index[IndexTable->Length++] = (UINT16) (UINTN) Variable;
}
return;
}