summaryrefslogtreecommitdiff
path: root/readconf.c
diff options
context:
space:
mode:
authordjm@openbsd.org <djm@openbsd.org>2021-06-08 22:06:12 +0000
committerDamien Miller <djm@mindrot.org>2021-06-09 08:32:03 +1000
commit1a6f6b08e62c78906a3032e8d9a83e721c84574e (patch)
tree9c154b65dd914777b84b5d96ad9e71562cd16d89 /readconf.c
parent78e30af3e2b2dd540a341cc827c6b98dd8b0a6de (diff)
upstream: fix regression in r1.356: for ssh_config options that
accepted multiple string arguments, ssh was only recording the first. Reported by Lucas via bugs@ OpenBSD-Commit-ID: 7cbf182f7449bf1cb7c5b4452667dc2b41170d6d
Diffstat (limited to 'readconf.c')
-rw-r--r--readconf.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/readconf.c b/readconf.c
index 842bbcd9..22e69cb3 100644
--- a/readconf.c
+++ b/readconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: readconf.c,v 1.356 2021/06/08 07:07:15 djm Exp $ */
+/* $OpenBSD: readconf.c,v 1.357 2021/06/08 22:06:12 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1243,6 +1243,7 @@ parse_string:
max_entries = SSH_MAX_HOSTS_FILES;
parse_char_array:
i = 0;
+ value = *uintptr == 0; /* was array empty when we started? */
while ((arg = argv_next(&ac, &av)) != NULL) {
if (*arg == '\0') {
error("%s line %d: keyword %s empty argument",
@@ -1259,7 +1260,7 @@ parse_char_array:
}
}
i++;
- if (*activep && *uintptr == 0) {
+ if (*activep && value) {
if ((*uintptr) >= max_entries) {
error("%s line %d: too many %s "
"entries.", filename, linenum,