summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordjm@openbsd.org <djm@openbsd.org>2023-09-08 06:34:24 +0000
committerDamien Miller <djm@mindrot.org>2023-09-08 16:35:40 +1000
commitbd1b9e52f5fa94d87223c90905c5fdc1a7c32aa6 (patch)
treed80a536860207c7248df3873f8ad75fb2877be07
parentc4f966482983e18601eec70a1563115de836616f (diff)
upstream: fix sizeof(*ptr) instead sizeof(ptr) in realloc (pointer here
is char**, so harmless); spotted in CID 416964 OpenBSD-Commit-ID: c61caa4a5a667ee20bb1042098861e6c72c69002
-rw-r--r--servconf.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/servconf.c b/servconf.c
index 3c2bf482..49f7f732 100644
--- a/servconf.c
+++ b/servconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: servconf.c,v 1.401 2023/09/06 23:35:35 djm Exp $ */
+/* $OpenBSD: servconf.c,v 1.402 2023/09/08 06:34:24 djm Exp $ */
/*
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
* All rights reserved
@@ -1957,15 +1957,15 @@ process_server_config_line_depth(ServerOptions *options, char *line,
options->subsystem_name = xrecallocarray(
options->subsystem_name, options->num_subsystems,
options->num_subsystems + 1,
- sizeof(options->subsystem_name));
+ sizeof(*options->subsystem_name));
options->subsystem_command = xrecallocarray(
options->subsystem_command, options->num_subsystems,
options->num_subsystems + 1,
- sizeof(options->subsystem_command));
+ sizeof(*options->subsystem_command));
options->subsystem_args = xrecallocarray(
options->subsystem_args, options->num_subsystems,
options->num_subsystems + 1,
- sizeof(options->subsystem_args));
+ sizeof(*options->subsystem_args));
options->subsystem_name[options->num_subsystems] = xstrdup(arg);
arg = argv_next(&ac, &av);
if (!arg || *arg == '\0') {
@@ -2721,13 +2721,13 @@ servconf_merge_subsystems(ServerOptions *dst, ServerOptions *src)
debug_f("add \"%s\"", src->subsystem_name[i]);
dst->subsystem_name = xrecallocarray(
dst->subsystem_name, dst->num_subsystems,
- dst->num_subsystems + 1, sizeof(dst->subsystem_name));
+ dst->num_subsystems + 1, sizeof(*dst->subsystem_name));
dst->subsystem_command = xrecallocarray(
dst->subsystem_command, dst->num_subsystems,
- dst->num_subsystems + 1, sizeof(dst->subsystem_command));
+ dst->num_subsystems + 1, sizeof(*dst->subsystem_command));
dst->subsystem_args = xrecallocarray(
dst->subsystem_args, dst->num_subsystems,
- dst->num_subsystems + 1, sizeof(dst->subsystem_args));
+ dst->num_subsystems + 1, sizeof(*dst->subsystem_args));
j = dst->num_subsystems++;
dst->subsystem_name[j] = xstrdup(src->subsystem_name[i]);
dst->subsystem_command[j] = xstrdup(src->subsystem_command[i]);