Check for minimal length of record when decoding HPE OEM 236.

Signed-off-by: Jerry Hoemann <jerry.hoem...@hpe.com>
---
 dmioem.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/dmioem.c b/dmioem.c
index 2f38229..f8ca3b4 100644
--- a/dmioem.c
+++ b/dmioem.c
@@ -543,6 +543,7 @@ static int dmi_decode_hp(const struct dmi_header *h)
                         *  0x14  | Name       | STRING| (deprecated) Backplane 
Name
                         */
                        pr_handle_name("%s HDD Backplane FRU Information", 
company);
+                       if (h->length < 0x08) break;
                        pr_attr("FRU I2C Address", "0x%X raw(0x%X)", data[0x4] 
>> 1, data[0x4]);
                        pr_attr("Box Number", "%d", WORD(data + 0x5));
                        pr_attr("NVRAM ID", "0x%X", WORD(data + 0x7));
-- 
2.26.2


_______________________________________________
https://lists.nongnu.org/mailman/listinfo/dmidecode-devel

Reply via email to