From 4abdc5981af9d44f1d71c4b9a810a25e8f3d4072 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Mon, 25 Mar 2024 16:59:27 +0100 Subject: [PATCH] cov: validate return from display_lvname Ensure strdup will not get NULL. --- tools/lvconvert.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/lvconvert.c b/tools/lvconvert.c index d90ea945f..7f25c86fb 100644 --- a/tools/lvconvert.c +++ b/tools/lvconvert.c @@ -2050,7 +2050,7 @@ static int _lvconvert_snapshot(struct cmd_context *cmd, uint32_t chunk_size; int zero; - if (!(snap_name = dm_pool_strdup(lv->vg->vgmem, display_lvname(lv)))) + if (!(snap_name = dm_pool_strdup(lv->vg->vgmem, (display_lvname(lv) ? : "")))) return_0; if (strcmp(lv->name, origin_name) == 0) {