From 36a24e9032591da8cc7688f69e7e9f5f41ffe4ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Sat, 10 Sep 2022 15:44:31 +0200 Subject: New upstream release --- lib/dimm_spd.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'lib/dimm_spd.c') diff --git a/lib/dimm_spd.c b/lib/dimm_spd.c index 41e30db..8204405 100644 --- a/lib/dimm_spd.c +++ b/lib/dimm_spd.c @@ -798,7 +798,7 @@ const struct valstr jedec_id5_vals[] = { { 0xE3, "WIS Technologies" }, { 0x64, "GateChange Technologies" }, { 0xE5, "High Density Devices AS" }, - { 0xE6, "Synopsys" }, + { 0xE6, "Synopsis" }, { 0x67, "Gigaram" }, { 0x68, "Enigma Semiconductor Inc." }, { 0xE9, "Century Micro Inc." }, @@ -1621,7 +1621,7 @@ ipmi_spd_print_fru(struct ipmi_intf * intf, uint8_t id) struct ipmi_rq req; struct fru_info fru; uint8_t *spd_data, msg_data[4]; - int len, offset; + uint32_t len, offset; msg_data[0] = id; @@ -1697,6 +1697,13 @@ ipmi_spd_print_fru(struct ipmi_intf * intf, uint8_t id) } len = rsp->data[0]; + if(rsp->data_len < 1 + || len > rsp->data_len - 1 + || len > fru.size - offset) + { + printf(" Not enough buffer size"); + return -1; + } memcpy(&spd_data[offset], rsp->data + 1, len); offset += len; } while (offset < fru.size); -- cgit v1.2.3