ID: 3610286 - 'lib/ipmi_sdr.c' - ipmi_sdr_print_type - incorrect eval

Commit fixes incorrect evaluation of str2uchar() return value in
ipmi_sdr_print_type(). Prior to this fix, practically no user input was accepted
as a valid one in # ipmitool sdr type HEX_SENSOR_TYPE ;

This bug was introduced by ID#3528368 - 'lib/ipmi_sdr.c' - possible int *flow
This commit is contained in:
Zdenek Styblik 2013-04-08 17:04:34 +00:00
parent 2dfa02ba24
commit 15f1255237

View File

@ -4444,7 +4444,7 @@ ipmi_sdr_print_type(struct ipmi_intf *intf, char *type)
if (strncmp(type, "0x", 2) == 0) {
/* begins with 0x so let it be entered as raw hex value */
if (str2uchar(type, &sensor_type) != 1) {
if (str2uchar(type, &sensor_type) != 0) {
lprintf(LOG_ERR,
"Given type of sensor \"%s\" is either invalid or out of range.",
type);