mirror of
https://github.com/ipmitool/ipmitool.git
synced 2025-05-10 18:47:22 +00:00
ID: 3600927 - change eval order of input param in ipmi_oem_setup()
Commit changes evaluation order of 'oemtype' which is an input parameter to ipmi_oem_setup() in 'lib/ipmi_oem.c'. Make the check whether 'oemtype' is NULL or not one of the first things we do rather than blindly use 'oemtype' in strncmp() and then check if it isn't NULL. Yes, this is a potential crash waiting to happen. Reported-by: Ales Ledvinka
This commit is contained in:
parent
5fa202f7d3
commit
69e43dc87f
@ -112,9 +112,9 @@ ipmi_oem_setup(struct ipmi_intf * intf, char * oemtype)
|
||||
struct ipmi_oem_handle * oem;
|
||||
int rc = 0;
|
||||
|
||||
if (strncmp(oemtype, "help", 4) == 0 ||
|
||||
strncmp(oemtype, "list", 4) == 0 ||
|
||||
oemtype == NULL) {
|
||||
if (oemtype == NULL ||
|
||||
strncmp(oemtype, "help", 4) == 0 ||
|
||||
strncmp(oemtype, "list", 4) == 0) {
|
||||
ipmi_oem_print();
|
||||
return -1;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user