mirror of
https://github.com/ipmitool/ipmitool.git
synced 2025-05-10 18:47:22 +00:00
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:
parent
2dfa02ba24
commit
15f1255237
@ -4444,7 +4444,7 @@ ipmi_sdr_print_type(struct ipmi_intf *intf, char *type)
|
|||||||
|
|
||||||
if (strncmp(type, "0x", 2) == 0) {
|
if (strncmp(type, "0x", 2) == 0) {
|
||||||
/* begins with 0x so let it be entered as raw hex value */
|
/* 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,
|
lprintf(LOG_ERR,
|
||||||
"Given type of sensor \"%s\" is either invalid or out of range.",
|
"Given type of sensor \"%s\" is either invalid or out of range.",
|
||||||
type);
|
type);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user