fru: Use inequality to judge table bounds check
If `p` points to any address beyond the end of the table then the table
should be considered completely processed. Requiring an exact match is a
recipe for trouble.
Fixes: #10
Reported-by: Frederic Barrat <fbarrat@linux.ibm.com>
Suggested-by: Frederic Barrat <fbarrat@linux.ibm.com>
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: Ia092d874411c58e0eba4f210001e6cda4d3b8695
diff --git a/src/fru.c b/src/fru.c
index 56b2ac6..4f6c496 100644
--- a/src/fru.c
+++ b/src/fru.c
@@ -206,7 +206,7 @@
static bool is_table_end(const struct pldm_fru_record_data_format *p,
const void *table, size_t table_size)
{
- return p ==
+ return p >=
(const struct pldm_fru_record_data_format *)((uint8_t *)table +
table_size);
}