mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
daemon: Error and exit if specified value for timeout is not valid
Silently setting "timeout" as -1 if the specified value is invalid is a bit confused.
This commit is contained in:
parent
21b5daa13d
commit
232392b1c6
@ -1311,8 +1311,10 @@ int main(int argc, char **argv) {
|
|||||||
if (virStrToLong_i(optarg, &tmp, 10, &timeout) != 0
|
if (virStrToLong_i(optarg, &tmp, 10, &timeout) != 0
|
||||||
|| timeout <= 0
|
|| timeout <= 0
|
||||||
/* Ensure that we can multiply by 1000 without overflowing. */
|
/* Ensure that we can multiply by 1000 without overflowing. */
|
||||||
|| timeout > INT_MAX / 1000)
|
|| timeout > INT_MAX / 1000) {
|
||||||
timeout = -1;
|
VIR_ERROR(_("Invalid value for timeout"));
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'p':
|
case 'p':
|
||||||
|
Loading…
Reference in New Issue
Block a user