]> sourceware.org Git - lvm2.git/commitdiff
fix segfault for invalid characters in vg name
authorDavid Teigland <teigland@redhat.com>
Thu, 29 Aug 2019 16:35:46 +0000 (11:35 -0500)
committerDavid Teigland <teigland@redhat.com>
Thu, 29 Aug 2019 16:35:46 +0000 (11:35 -0500)
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.

lib/metadata/metadata.c

index 2c61bdeca23a23d1a6a00a641e043ab8db0fb1ce..6d21ff99cc8ef9d90c34d475a8d349195d6080d5 100644 (file)
@@ -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;
        }
 
        /*
This page took 0.038376 seconds and 5 git commands to generate.