From: Duncan L. <ice...@us...> - 2006-07-28 16:41:54
|
Update of /cvsroot/ipmitool/ipmitool/lib In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv16863/lib Modified Files: ipmi_oem.c Log Message: fix segfault when incorrect oem option supplied Index: ipmi_oem.c =================================================================== RCS file: /cvsroot/ipmitool/ipmitool/lib/ipmi_oem.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ipmi_oem.c 19 Mar 2006 20:04:20 -0000 1.8 --- ipmi_oem.c 28 Jul 2006 16:39:18 -0000 1.9 *************** *** 64,68 **** setup: ipmi_oem_ibm, }, ! { 0 }, }; --- 64,68 ---- setup: ipmi_oem_ibm, }, ! { 0 } }; *************** *** 111,115 **** { struct ipmi_oem_handle * oem; - int i; int rc = 0; --- 111,114 ---- *************** *** 121,136 **** } ! for (oem=ipmi_oem_list, i=0; i < sizeof(ipmi_oem_list)/sizeof(struct ipmi_oem_handle); oem++, i++) { ! if (oem->name == NULL) ! continue; if (strncmp(oemtype, oem->name, strlen(oem->name)) == 0) break; } ! if (oem->name == NULL) { ! /* nothing was found */ ! lprintf(LOG_ERR, "OEM support not found for \"%s\"", oemtype); return -1; - } /* save pointer for later use */ --- 120,130 ---- } ! for (oem=ipmi_oem_list; oem->name != NULL; oem++) { if (strncmp(oemtype, oem->name, strlen(oem->name)) == 0) break; } ! if (oem->name == NULL) return -1; /* save pointer for later use */ *************** *** 165,167 **** return 0; } - --- 159,160 ---- |