=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ssh/readconf.c,v retrieving revision 1.344 retrieving revision 1.345 diff -u -r1.344 -r1.345 --- src/usr.bin/ssh/readconf.c 2020/12/17 23:10:27 1.344 +++ src/usr.bin/ssh/readconf.c 2020/12/21 09:19:53 1.345 @@ -1,4 +1,4 @@ -/* $OpenBSD: readconf.c,v 1.344 2020/12/17 23:10:27 djm Exp $ */ +/* $OpenBSD: readconf.c,v 1.345 2020/12/21 09:19:53 djm Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -2762,7 +2762,7 @@ { char *orig, *sdup, *cp; char *host = NULL, *user = NULL; - int ret = -1, port = -1, first; + int r, ret = -1, port = -1, first; active &= o->proxy_command == NULL && o->jump_host == NULL; @@ -2778,13 +2778,18 @@ if (first) { /* First argument and configuration is active */ - if (parse_ssh_uri(cp, &user, &host, &port) == -1 && - parse_user_host_port(cp, &user, &host, &port) != 0) + r = parse_ssh_uri(cp, &user, &host, &port); + if (r == -1 || (r == 1 && + parse_user_host_port(cp, &user, &host, &port) != 0)) goto out; } else { /* Subsequent argument or inactive configuration */ if (parse_ssh_uri(cp, NULL, NULL, NULL) == -1 && parse_user_host_port(cp, NULL, NULL, NULL) != 0) + goto out; + r = parse_ssh_uri(cp, NULL, NULL, NULL); + if (r == -1 || (r == 1 && + parse_user_host_port(cp, NULL, NULL, NULL) != 0)) goto out; } first = 0; /* only check syntax for subsequent hosts */