Daniele Forsi (dforsi@gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/6373
-gerrit
commit 431749f109a21c4e33a94c18e004e09e4a4b9eca Author: Daniele Forsi dforsi@gmail.com Date: Sat Jul 26 11:12:49 2014 +0200
.../model_10xxx/update_microcode.c: fix array read out of bounds
Found by Cppcheck 1.65. NOT compile-tested. Fixes: [src/cpu/amd/model_10xxx/update_microcode.c:83]: (error) Array 'id_mapping_table[28]' accessed at index 110, which is out of bounds.
Change-Id: I70322e38a49548e05131e23b1f7ba5289feaf468 Signed-off-by: Daniele Forsi dforsi@gmail.com --- src/cpu/amd/model_10xxx/update_microcode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/cpu/amd/model_10xxx/update_microcode.c b/src/cpu/amd/model_10xxx/update_microcode.c index 95624e9..a59d88b 100644 --- a/src/cpu/amd/model_10xxx/update_microcode.c +++ b/src/cpu/amd/model_10xxx/update_microcode.c @@ -79,7 +79,7 @@ static u32 get_equivalent_processor_rev_id(u32 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;