summaryrefslogtreecommitdiff
path: root/servconf.c
diff options
context:
space:
mode:
authordjm@openbsd.org <djm@openbsd.org>2017-10-02 19:33:20 +0000
committerDamien Miller <djm@mindrot.org>2017-10-03 06:34:26 +1100
commit66bf74a92131b7effe49fb0eefe5225151869dc5 (patch)
tree71a79e03a25a2381339989d22baaa5862f877b7a /servconf.c
parentd63b38160a59039708fd952adc75a0b3da141560 (diff)
upstream commit
Fix PermitOpen crash; spotted by benno@, ok dtucker@ deraadt@ Upstream-ID: c2cc84ffac070d2e1ff76182c70ca230a387983c
Diffstat (limited to 'servconf.c')
-rw-r--r--servconf.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/servconf.c b/servconf.c
index 16436512e..2c321a4ad 100644
--- a/servconf.c
+++ b/servconf.c
@@ -1,5 +1,5 @@
1 1
2/* $OpenBSD: servconf.c,v 1.311 2017/09/18 09:41:52 dtucker Exp $ */ 2/* $OpenBSD: servconf.c,v 1.312 2017/10/02 19:33:20 djm Exp $ */
3/* 3/*
4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
5 * All rights reserved 5 * All rights reserved
@@ -2063,6 +2063,13 @@ copy_set_server_options(ServerOptions *dst, ServerOptions *src, int preauth)
2063 dst->n[dst->num_n] = xstrdup(src->n[dst->num_n]); \ 2063 dst->n[dst->num_n] = xstrdup(src->n[dst->num_n]); \
2064 } \ 2064 } \
2065} while(0) 2065} while(0)
2066#define M_CP_STRARRAYOPT_ALLOC(n, num_n) do { \
2067 if (src->num_n != 0) { \
2068 dst->n = xcalloc(src->num_n, sizeof(*dst->n)); \
2069 M_CP_STRARRAYOPT(n, num_n); \
2070 dst->num_n = src->num_n; \
2071 } \
2072} while(0)
2066 2073
2067 /* See comment in servconf.h */ 2074 /* See comment in servconf.h */
2068 COPY_MATCH_STRING_OPTS(); 2075 COPY_MATCH_STRING_OPTS();
@@ -2093,6 +2100,7 @@ copy_set_server_options(ServerOptions *dst, ServerOptions *src, int preauth)
2093#undef M_CP_INTOPT 2100#undef M_CP_INTOPT
2094#undef M_CP_STROPT 2101#undef M_CP_STROPT
2095#undef M_CP_STRARRAYOPT 2102#undef M_CP_STRARRAYOPT
2103#undef M_CP_STRARRAYOPT_ALLOC
2096 2104
2097void 2105void
2098parse_server_config(ServerOptions *options, const char *filename, Buffer *conf, 2106parse_server_config(ServerOptions *options, const char *filename, Buffer *conf,