summaryrefslogtreecommitdiff
path: root/lib/dimm_spd.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/dimm_spd.c')
-rw-r--r--lib/dimm_spd.c11
1 files changed, 9 insertions, 2 deletions
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);