libpldm: Fix the check for the valid data length
The data passed to decode_get_firmware_parameters_resp_comp_entry may
contain multiple component entries. In such scenarios the length
field will be more than that is calculated, modifying the check
to meet the minimum criteria.
Signed-off-by: Tom Joseph <rushtotom@gmail.com>
Change-Id: Ibb63dd953acb9fcc6f6cd116390f459352fea27c
diff --git a/libpldm/firmware_update.c b/libpldm/firmware_update.c
index b5b1162..12043a2 100644
--- a/libpldm/firmware_update.c
+++ b/libpldm/firmware_update.c
@@ -564,7 +564,7 @@
entry->active_comp_ver_str_len +
entry->pending_comp_ver_str_len;
- if (length != entry_length) {
+ if (length < entry_length) {
return PLDM_ERROR_INVALID_LENGTH;
}