Klockwork Issue Fix : Index range check
Though the caller of smbiosIsUpdating() is handling index range check
(#757), it is preferable that the function also has the right check in
place. With the present implementation, index can go up to maxDirEntries
which is not the correct functionality. This commit fixes the range
check.
Signed-off-by: P Dheeraj Srujan Kumar <p.dheeraj.srujan.kumar@intel.com>
Change-Id: I4f3cb15c3a26e9462ee6e0f425c8e9156bce4731
diff --git a/src/smbiosmdrv2handler.cpp b/src/smbiosmdrv2handler.cpp
index 058c3ee..ea4a794 100644
--- a/src/smbiosmdrv2handler.cpp
+++ b/src/smbiosmdrv2handler.cpp
@@ -194,7 +194,7 @@
bool MDRV2::smbiosIsUpdating(uint8_t index)
{
- if (index > maxDirEntries)
+ if (index >= maxDirEntries)
{
return false;
}