mirror of
https://github.com/ipmitool/ipmitool.git
synced 2026-01-21 16:42:19 +08:00
ID: 3528308 - 'lib/ipmi_hpmfwupg.c' - possible int *flow
Commit replaces atoi() call with str2int() and puts a limit on accepted values for Component ID to <0..7>.
This commit is contained in:
parent
8e94374cf1
commit
bfba2f83f5
@ -3855,7 +3855,13 @@ int ipmi_hpmfwupg_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
{
|
||||
if (i+1 < argc)
|
||||
{
|
||||
componentId = atoi(argv[i+1]);
|
||||
if (str2int(argv[i+1], &componentId) != 0 ||
|
||||
componentId < 0 || componentId > 7) {
|
||||
lprintf(LOG_ERR, "Given Component ID '%s' is invalid.",
|
||||
argv[i+1]);
|
||||
lprintf(LOG_ERR, "Valid Compoment ID is: <0..7>");
|
||||
return (-1);
|
||||
}
|
||||
option &= ~(VERSIONCHECK_MODE);
|
||||
option &= ~(VIEW_MODE);
|
||||
option |= FORCE_MODE_COMPONENT;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user