From 9811f79eaeb4ce92a64947ea826450d8b4a9e597 Mon Sep 17 00:00:00 2001 From: Jim Mankovich Date: Thu, 1 Jan 2015 09:16:34 -0700 Subject: [PATCH] ID:357 - out-of-bound access in DDR4 code ID:356 - DIMM4 Die Count is unreachable --- lib/dimm_spd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/dimm_spd.c b/lib/dimm_spd.c index d12a301..245599d 100644 --- a/lib/dimm_spd.c +++ b/lib/dimm_spd.c @@ -870,8 +870,8 @@ ipmi_spd_print(uint8_t *spd_data, int len) uint32_t year; uint32_t week; - if (len < 148) - return -1; /* we need first 91 bytes to do our thing */ + if (len < 348) + return -1; /* "Logical rank" referes to the individually addressable die * in a 3DS stack and has no meaning for monolithic or @@ -881,7 +881,7 @@ ipmi_spd_print(uint8_t *spd_data, int len) * rank per package rank. */ lrank_dimm = (spd_data[12]>>3&0x3) + 1; /* Number of Package Ranks per DIMM */ - if ((spd_data[6] & 0x3) == 0x10) { /* 3DS package Type */ + if ((spd_data[6] & 0x3) == 0x2) { /* 3DS package Type */ lrank_dimm *= ((spd_data[6]>>4)&0x3) + 1; /* Die Count */ } sdram_cap = ldexp(256,(spd_data[4]&15));