=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ssh/readconf.c,v retrieving revision 1.257 retrieving revision 1.258 diff -u -r1.257 -r1.258 --- src/usr.bin/ssh/readconf.c 2016/07/15 00:24:30 1.257 +++ src/usr.bin/ssh/readconf.c 2016/07/20 10:45:27 1.258 @@ -1,4 +1,4 @@ -/* $OpenBSD: readconf.c,v 1.257 2016/07/15 00:24:30 djm Exp $ */ +/* $OpenBSD: readconf.c,v 1.258 2016/07/20 10:45:27 naddy Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -2269,13 +2269,14 @@ { char *orig, *sdup, *cp; char *host = NULL, *user = NULL; - int ret = -1, port = -1; + int ret = -1, port = -1, first; active &= o->proxy_command == NULL && o->jump_host == NULL; orig = sdup = xstrdup(s); + first = active; while ((cp = strsep(&sdup, ",")) && cp != NULL) { - if (active) { + if (first) { /* First argument and configuration is active */ if (parse_user_host_port(cp, &user, &host, &port) != 0) goto out; @@ -2284,19 +2285,21 @@ if (parse_user_host_port(cp, NULL, NULL, NULL) != 0) goto out; } - active = 0; /* only check syntax for subsequent hosts */ + first = 0; /* only check syntax for subsequent hosts */ } /* success */ - free(orig); - o->jump_user = user; - o->jump_host = host; - o->jump_port = port; - o->proxy_command = xstrdup("none"); - user = host = NULL; - if ((cp = strchr(s, ',')) != NULL && cp[1] != '\0') - o->jump_extra = xstrdup(cp + 1); + if (active) { + o->jump_user = user; + o->jump_host = host; + o->jump_port = port; + o->proxy_command = xstrdup("none"); + user = host = NULL; + if ((cp = strchr(s, ',')) != NULL && cp[1] != '\0') + o->jump_extra = xstrdup(cp + 1); + } ret = 0; out: + free(orig); free(user); free(host); return ret;