Add more check for index whether exceed maximum value of fv count.
[mirror_edk2.git] / EdkModulePkg / Library / EdkFvbServiceLib / x64 / Fvb.c
index e9d7500..4dcb81d 100644 (file)
@@ -102,7 +102,8 @@ Returns:
       //\r
       // Use the next free slot for a new entry\r
       //\r
-      UpdateIndex                   = mFvbCount++;;\r
+      UpdateIndex                   = mFvbCount++;\r
+                       ASSERT (UpdateIndex < MAX_FVB_COUNT);      \r
       mFvbEntry[UpdateIndex].Handle = Handle;\r
     }\r
     //\r