From 64f0efd33f5ad1a37ae322749da4f85e363792d5 Mon Sep 17 00:00:00 2001 From: Alasdair Kergon Date: Tue, 19 Jun 2007 15:47:20 +0000 Subject: [PATCH] Fix dmsetup -o devno string termination. (1.02.20) --- WHATS_NEW_DM | 1 + tools/dmsetup.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM index 14ffb10fc..c133c28a6 100644 --- a/WHATS_NEW_DM +++ b/WHATS_NEW_DM @@ -1,5 +1,6 @@ Version 1.02.21 - ================================ + Fix dmsetup -o devno string termination. (1.02.20) Version 1.02.20 - 15th June 2007 ================================ diff --git a/tools/dmsetup.c b/tools/dmsetup.c index c3069b2d2..a4d0ce6e4 100644 --- a/tools/dmsetup.c +++ b/tools/dmsetup.c @@ -1629,7 +1629,7 @@ static int _dm_info_devno_disp(struct dm_report *rh, struct dm_pool *mem, goto out_abandon; } - if (!dm_pool_grow_object(mem, buf, strlen(buf))) { + if (!dm_pool_grow_object(mem, buf, strlen(buf) + 1)) { log_error("dm_pool_grow_object failed"); goto out_abandon; } @@ -1662,7 +1662,7 @@ static int _dm_tree_names(struct dm_report *rh, struct dm_pool *mem, name = dm_tree_node_get_name(parent); if (!name || !*name) continue; - if (!first_node && !dm_pool_grow_object(mem, ",", 1)) { + if (!first_node && !dm_pool_grow_object(mem, ",", 2)) { log_error("dm_pool_grow_object failed"); goto out_abandon; } -- 2.43.5