diff options
author | djm@openbsd.org <djm@openbsd.org> | 2017-10-02 19:33:20 +0000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2017-10-03 06:34:26 +1100 |
commit | 66bf74a92131b7effe49fb0eefe5225151869dc5 (patch) | |
tree | 71a79e03a25a2381339989d22baaa5862f877b7a /servconf.c | |
parent | d63b38160a59039708fd952adc75a0b3da141560 (diff) |
upstream commit
Fix PermitOpen crash; spotted by benno@, ok dtucker@ deraadt@
Upstream-ID: c2cc84ffac070d2e1ff76182c70ca230a387983c
Diffstat (limited to 'servconf.c')
-rw-r--r-- | servconf.c | 10 |
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 | ||
2097 | void | 2105 | void |
2098 | parse_server_config(ServerOptions *options, const char *filename, Buffer *conf, | 2106 | parse_server_config(ServerOptions *options, const char *filename, Buffer *conf, |