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 3e9ea86c111dedf8caed7602a1d84e427a58b86c Author: Daniele Forsi dforsi@gmail.com Date: Sat Jul 26 11:14:03 2014 +0200
.../model_fxx/model_fxx_update_microcode.c: fix array read out of bounds
Found by Cppcheck 1.65. NOT compile-tested. 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;