[openssh-commits] [openssh] 01/02: upstream: Prevent integer overflow when ridiculously large

git+noreply at mindrot.org git+noreply at mindrot.org
Fri Nov 13 09:59:14 AEDT 2020


This is an automated email from the git hooks/post-receive script.

dtucker pushed a commit to branch master
in repository openssh.

commit 819b44e8b9af6ce18d3ec7505b9f461bf7991a1f
Author: dtucker at openbsd.org <dtucker at openbsd.org>
Date:   Thu Nov 12 22:38:57 2020 +0000

    upstream: Prevent integer overflow when ridiculously large
    
    ConnectTimeout is specified, capping the effective value (for most platforms)
    at 24 days. bz#3229, ok djm@
    
    OpenBSD-Commit-ID: 62d4c4b7b87d111045f8e9f28b5b532d17ac5bc0
---
 ssh.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/ssh.c b/ssh.c
index 85c6e6c5..f467ba2d 100644
--- a/ssh.c
+++ b/ssh.c
@@ -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 <ylo at cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo at cs.hut.fi>, Espoo, Finland
@@ -1523,7 +1523,10 @@ main(int ac, char **av)
 			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,

-- 
To stop receiving notification emails like this one, please contact
djm at mindrot.org.


More information about the openssh-commits mailing list