[lvm-devel] master - libdm: check for empty aux_data in _parse_aux_data_group()

Bryn Reeves bmr at fedoraproject.org
Wed Jul 6 15:32:36 UTC 2016


Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=bf1dfea393b5372b6fe058458c2fc25188e8181b
Commit:        bf1dfea393b5372b6fe058458c2fc25188e8181b
Parent:        c1a66d4fc6cd2224e3bf1f2cd08f4ee89b4ea920
Author:        Bryn M. Reeves <bmr at redhat.com>
AuthorDate:    Wed Jul 6 16:29:06 2016 +0100
Committer:     Bryn M. Reeves <bmr at redhat.com>
CommitterDate: Wed Jul 6 16:31:30 2016 +0100

libdm: check for empty aux_data in _parse_aux_data_group()

If after extracting stats arguments and group tags nothing remains
of aux_data but '-' set the region->aux_data field to the empty
string to match behaviour for non-grouped regions.
---
 libdm/libdm-stats.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libdm/libdm-stats.c b/libdm/libdm-stats.c
index 12c821f..e979b34 100644
--- a/libdm/libdm-stats.c
+++ b/libdm/libdm-stats.c
@@ -692,7 +692,7 @@ static int _parse_aux_data_group(struct dm_stats *dms,
 	}
 
 	/* separate group tag from user aux_data */
-	if (strlen(end))
+	if ((strlen(end) > 1) || strncmp(end, "-", 1))
 		c = dm_strdup(end);
 	else
 		c = dm_strdup("");




More information about the lvm-devel mailing list