From: David Teigland Date: Thu, 29 Aug 2019 16:35:46 +0000 (-0500) Subject: fix segfault for invalid characters in vg name X-Git-Tag: v2_03_06~146 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=7cfbf3a394c2663fbeed17705320b83e69781720;p=lvm2.git fix segfault for invalid characters in vg name Fixes a regression from commit ba7ff96faff0 "improve reading and repairing vg metadata" where the error path for a vg name with invalid charaters was missing an error flag, which led to the caller not recognizing an error occured. Previously, an error flag was hidden in the old _vg_make_handle function. --- diff --git a/lib/metadata/metadata.c b/lib/metadata/metadata.c index 2c61bdeca..6d21ff99c 100644 --- a/lib/metadata/metadata.c +++ b/lib/metadata/metadata.c @@ -4900,7 +4900,8 @@ struct volume_group *vg_read(struct cmd_context *cmd, const char *vg_name, const if (!validate_name(vg_name)) { log_error("Volume group name \"%s\" has invalid characters.", vg_name); - return NULL; + failure |= FAILED_NOTFOUND; + goto_bad; } /*