Add input validation for time-out parameter in 'src/ipmievd.c'.

This commit is contained in:
Zdenek Styblik 2012-01-25 11:53:41 +00:00
parent 9217312cc4
commit e29166e4e8

View File

@ -715,7 +715,11 @@ ipmievd_main(struct ipmi_event_intf * eintf, int argc, char ** argv)
daemon = 0;
}
else if (strncasecmp(argv[i], "timeout=", 8) == 0) {
selwatch_timeout = strtoul(argv[i]+8, NULL, 0);
if ( (str2int(argv[i]+8, &selwatch_timeout) != 0) ||
selwatch_timeout < 0) {
lprintf(LOG_ERR, "Invalid input given or out of range for time-out.");
return (-1);
}
}
else if (strncasecmp(argv[i], "pidfile=", 8) == 0) {
memset(pidfile, 0, 64);