Fix out-of-bound-reads in get_supermicro_evt_desc()

CID#1149029 and CID#1149030
This commit is contained in:
Zdenek Styblik
2015-01-08 20:22:15 +01:00
parent e4be291c65
commit af276d4082
2 changed files with 11 additions and 11 deletions

View File

@@ -594,14 +594,14 @@ get_supermicro_evt_desc(struct ipmi_intf *intf, struct sel_event_record *rec)
return NULL;
}
length = sizeof(supermicro_X8);
for (i = 0; i < length; i++) {
for (i = 0; i < length && supermicro_X8[i] != 0xFFFF; i++) {
if (oem_id == supermicro_X8[i]) {
chipset_type = 0;
break;
}
}
length = sizeof(supermicro_x9);
for (i = 0; i < length; i++) {
for (i = 0; i < length && supermicro_x9[i] != 0xFFFF; i++) {
if (oem_id == supermicro_x9[i]) {
chipset_type = 2;
break;