Add more check for index whether exceed maximum value of fv count.
authorklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 19 Dec 2006 02:44:36 +0000 (02:44 +0000)
committerklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 19 Dec 2006 02:44:36 +0000 (02:44 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2114 6f19259b-4bc3-4df7-8a09-765794883524

EdkModulePkg/Library/EdkFvbServiceLib/Ia32/Fvb.c

index 222fb9b..04693eb 100644 (file)
@@ -100,7 +100,11 @@ Returns:
       //\r
       // Use the next free slot for a new entry\r
       //\r
-      UpdateIndex                   = mFvbCount++;;\r
+      UpdateIndex                   = mFvbCount++;\r
+      //\r
+      // Check the UpdateIndex whether exceed the maximum value.\r
+      //\r
+      ASSERT (UpdateIndex < MAX_FVB_COUNT);\r
       mFvbEntry[UpdateIndex].Handle = Handle;\r
     }\r
     //\r