Daniele Forsi (dforsi@gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/6374
-gerrit
commit 1a680c189b34188f83746fc919a86e424ed38f8e Author: Daniele Forsi dforsi@gmail.com Date: Sat Jul 26 11:14:03 2014 +0200
cpu/amd/model_fxx/model_fxx_update_microcode.c: Do not access arrays out of bounds
Found by Cppcheck 1.65. When !CONFIG_K8_REV_F_SUPPORT fixes: [src/cpu/amd/model_fxx/model_fxx_update_microcode.c:80]: (error) Array 'id_mapping_table[34]' accessed at index 134, which is out of bounds. When CONFIG_K8_REV_F_SUPPORT fixes: [src/cpu/amd/model_fxx/model_fxx_update_microcode.c:80]: (error) Array 'id_mapping_table[1]' accessed at index 2, which is out of bounds.
Change-Id: Icaad71530895297171ed75b5895f65d5777bccf4 Signed-off-by: Daniele Forsi dforsi@gmail.com --- src/cpu/amd/model_fxx/model_fxx_update_microcode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/cpu/amd/model_fxx/model_fxx_update_microcode.c b/src/cpu/amd/model_fxx/model_fxx_update_microcode.c index 4a53fea..5300db2 100644 --- a/src/cpu/amd/model_fxx/model_fxx_update_microcode.c +++ b/src/cpu/amd/model_fxx/model_fxx_update_microcode.c @@ -76,7 +76,7 @@ static unsigned get_equivalent_processor_rev_id(unsigned orig_id) {
new_id = 0;
- for(i=0; i<sizeof(id_mapping_table); i+=2 ) { + for(i=0; i<sizeof(id_mapping_table)/sizeof(*id_mapping_table); i+=2 ) { if(id_mapping_table[i]==orig_id) { new_id = id_mapping_table[i+1]; break;