From 15f1255237947c4ecb3e0ce585cbb08abc41a64b Mon Sep 17 00:00:00 2001 From: Zdenek Styblik Date: Mon, 8 Apr 2013 17:04:34 +0000 Subject: [PATCH] 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 --- ipmitool/lib/ipmi_sdr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ipmitool/lib/ipmi_sdr.c b/ipmitool/lib/ipmi_sdr.c index 85e0cb7..2a44be4 100644 --- a/ipmitool/lib/ipmi_sdr.c +++ b/ipmitool/lib/ipmi_sdr.c @@ -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);