summaryrefslogtreecommitdiffstats
path: root/src/usr/diag/prdf
diff options
context:
space:
mode:
authorZane Shelley <zshelle@us.ibm.com>2017-05-01 11:30:26 -0500
committerZane C. Shelley <zshelle@us.ibm.com>2017-05-04 14:17:08 -0400
commit3a32bbd54815b9a6a09da2349fb56c8aad98341a (patch)
tree9095f1967bdead92a2b571e99f33b3d870642c06 /src/usr/diag/prdf
parent98a02a3e9ae529f5383d240fd8daa8f73013f043 (diff)
downloadtalos-hostboot-3a32bbd54815b9a6a09da2349fb56c8aad98341a.tar.gz
talos-hostboot-3a32bbd54815b9a6a09da2349fb56c8aad98341a.zip
PRD: Fixed parsing bug in MEM_CE_TABLE
Iterating one too many times if extra unused data at the end of the buffer. Change-Id: Ic3f8027f5734e7222ce63729c91c4b26a83deab5 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/39888 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Reviewed-by: Caleb N. Palmer <cnpalmer@us.ibm.com> Reviewed-by: Benjamin J. Weisenbeck <bweisenb@us.ibm.com> Reviewed-by: Brian J. Stegmiller <bjs@us.ibm.com> Reviewed-by: Zane C. Shelley <zshelle@us.ibm.com> Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/39968 Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Diffstat (limited to 'src/usr/diag/prdf')
-rw-r--r--src/usr/diag/prdf/common/plugins/prdfMemLogParse.C11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/usr/diag/prdf/common/plugins/prdfMemLogParse.C b/src/usr/diag/prdf/common/plugins/prdfMemLogParse.C
index 0b7e4f17f..d39751f56 100644
--- a/src/usr/diag/prdf/common/plugins/prdfMemLogParse.C
+++ b/src/usr/diag/prdf/common/plugins/prdfMemLogParse.C
@@ -3072,10 +3072,10 @@ bool parseMemCeTable( uint8_t * i_buffer, uint32_t i_buflen,
i_parser.PrintNumber( " MEM_CE_TABLE", "%d", entries );
- const char * hh = " A H Count RC";
+ const char * hh = " A H Count RC";
const char * hd = "Rank P Bank Row Column DRAM Pins S E Site";
i_parser.PrintString( hh, hd );
- hh = " - - ----- ----";
+ hh = " - - ----- ----";
hd = "---- - ---- ------- ------ ---- ---- - - ------";
i_parser.PrintString( hh, hd );
@@ -3087,8 +3087,9 @@ bool parseMemCeTable( uint8_t * i_buffer, uint32_t i_buflen,
// Bytes 2-7 are currently unused.
// Get the entry info.
- for ( uint32_t idx = METADATA_SIZE; idx < i_buflen;
- idx += CE_TABLE::ENTRY_SIZE )
+ for ( uint32_t idx = METADATA_SIZE, entry = 0;
+ idx < i_buflen && entry < entries;
+ idx += CE_TABLE::ENTRY_SIZE, entry++ )
{
uint32_t count = i_buffer[idx ]; // 8-bit
// 5 spare bits // 5-bit
@@ -3157,7 +3158,7 @@ bool parseMemCeTable( uint8_t * i_buffer, uint32_t i_buflen,
// Build the header string.
char header[HEADER_SIZE] = { '\0' };
- snprintf( header, HEADER_SIZE, " %c %c %3d %s ", active_char,
+ snprintf( header, HEADER_SIZE, " %c %c %3d %s ", active_char,
isHard_char, count, cardName_str );
// Build the data string.
OpenPOWER on IntegriCloud