=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ssh/readconf.c,v retrieving revision 1.299 retrieving revision 1.300 diff -u -r1.299 -r1.300 --- src/usr.bin/ssh/readconf.c 2018/10/03 06:38:35 1.299 +++ src/usr.bin/ssh/readconf.c 2018/10/05 14:26:09 1.300 @@ -1,4 +1,4 @@ -/* $OpenBSD: readconf.c,v 1.299 2018/10/03 06:38:35 djm Exp $ */ +/* $OpenBSD: readconf.c,v 1.300 2018/10/05 14:26:09 naddy Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -1143,7 +1143,20 @@ return 0; case oPort: - intptr = &options->port; + arg = strdelim(&s); + if (!arg || *arg == '\0') + fatal("%.200s line %d: Missing argument.", + filename, linenum); + value = a2port(arg); + if (value <= 0) + fatal("%.200s line %d: Bad port '%s'.", + filename, linenum, arg); + if (*activep && options->port == -1) + options->port = value; + break; + + case oConnectionAttempts: + intptr = &options->connection_attempts; parse_int: arg = strdelim(&s); if ((errstr = atoi_err(arg, &value)) != NULL) @@ -1152,10 +1165,6 @@ if (*activep && *intptr == -1) *intptr = value; break; - - case oConnectionAttempts: - intptr = &options->connection_attempts; - goto parse_int; case oCiphers: arg = strdelim(&s);