From a187f02ed537ada54feddb9fc7b9f1cb8e4ad75a Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Sun, 9 Feb 2025 21:59:34 +0100 Subject: [PATCH] vdo: correctly size string array Fix logging of VDO configuration info message which has acutally printed " and," using next element.. Increase the array element size so it can store >=5 bytes for " and" + \0. --- lib/metadata/vdo_manip.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/metadata/vdo_manip.c b/lib/metadata/vdo_manip.c index a8799e09b..21084468f 100644 --- a/lib/metadata/vdo_manip.c +++ b/lib/metadata/vdo_manip.c @@ -759,7 +759,7 @@ static int _vdo_snprintf(char **buf, size_t *bufsize, const char *format, ...) int check_vdo_constrains(struct cmd_context *cmd, const struct vdo_pool_size_config *cfg) { - static const char _vdo_split[][4] = { "", " and", ",", "," }; + static const char _vdo_split[][8] = { "", " and", ",", "," }; uint64_t req_mb, total_mb, available_mb; uint64_t phy_mb = _round_sectors_to_tib(UINT64_C(268) * cfg->physical_size); // 268 MiB per 1 TiB of physical size uint64_t virt_mb = _round_1024(UINT64_C(1638) * _round_sectors_to_tib(cfg->virtual_size)); // 1.6 MiB per 1 TiB