From: Florian Schmaus Date: Thu, 9 Nov 2023 07:59:59 +0000 (+0100) Subject: core: fix array size in unit_log_resources() X-Git-Tag: v255-rc2~66 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=893028523469b3ec459388428ddc466942cdaf4d;p=thirdparty%2Fsystemd.git core: fix array size in unit_log_resources() In 0531bded79dc ("core: include peak memory in unit_log_resources()") new log messages where added, however the size of the according arrays to hold the messages was not adjusted. Fixes: 0531bded79dc ("core: include peak memory in unit_log_resources()") --- diff --git a/src/core/unit.c b/src/core/unit.c index d7e7da40c21..4ac8d0adc03 100644 --- a/src/core/unit.c +++ b/src/core/unit.c @@ -2319,12 +2319,12 @@ static int raise_level(int log_level, bool condition_info, bool condition_notice } static int unit_log_resources(Unit *u) { - struct iovec iovec[1 + _CGROUP_IP_ACCOUNTING_METRIC_MAX + _CGROUP_IO_ACCOUNTING_METRIC_MAX + 4]; + struct iovec iovec[1 + 1 + _CGROUP_IP_ACCOUNTING_METRIC_MAX + _CGROUP_IO_ACCOUNTING_METRIC_MAX + 4]; bool any_traffic = false, have_ip_accounting = false, any_io = false, have_io_accounting = false; _cleanup_free_ char *igress = NULL, *egress = NULL, *rr = NULL, *wr = NULL; int log_level = LOG_DEBUG; /* May be raised if resources consumed over a threshold */ size_t n_message_parts = 0, n_iovec = 0; - char* message_parts[1 + 2 + 2 + 1], *t; + char* message_parts[1 + 1 + 2 + 2 + 1], *t; nsec_t nsec = NSEC_INFINITY; uint64_t memory_peak = UINT64_MAX; int r;