=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ssh/ssh.c,v retrieving revision 1.541 retrieving revision 1.542 diff -u -r1.541 -r1.542 --- src/usr.bin/ssh/ssh.c 2020/11/08 11:46:12 1.541 +++ src/usr.bin/ssh/ssh.c 2020/11/12 22:38:57 1.542 @@ -1,4 +1,4 @@ -/* $OpenBSD: ssh.c,v 1.541 2020/11/08 11:46:12 dtucker Exp $ */ +/* $OpenBSD: ssh.c,v 1.542 2020/11/12 22:38:57 dtucker Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -1502,7 +1502,10 @@ cleanup_exit(255); /* resolve_host logs the error */ } - timeout_ms = options.connection_timeout * 1000; + if (options.connection_timeout >= INT_MAX/1000) + timeout_ms = INT_MAX; + else + timeout_ms = options.connection_timeout * 1000; /* Open a connection to the remote host. */ if (ssh_connect(ssh, host, host_arg, addrs, &hostaddr, options.port,