mirror of
https://github.com/ipmitool/ipmitool.git
synced 2025-05-10 10:37:22 +00:00
ID: 3528368 - 'lib/ipmi_sdr.c' - possible int *flow
Commit fixes possible int *flow in ipmi_sdr_print_type() in 'lib/ipmi_sdr.c'. str2uchar() is used instead of strtol() which wasn't being checked for errors. Reported by: Duncan Idaho
This commit is contained in:
parent
2edc474cef
commit
5b90f68407
@ -4323,7 +4323,12 @@ 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 */
|
||||
sensor_type = (uint8_t) strtol(type, NULL, 0);
|
||||
if (str2uchar(type, &sensor_type) != 1) {
|
||||
lprintf(LOG_ERR,
|
||||
"Given type of sensor \"%s\" is either invalid or out of range.",
|
||||
type);
|
||||
return (-1);
|
||||
}
|
||||
} else {
|
||||
for (x = 1; x < SENSOR_TYPE_MAX; x++) {
|
||||
if (strncasecmp(sensor_type_desc[x], type,
|
||||
|
Loading…
x
Reference in New Issue
Block a user