diff --git a/device_mapper/libdm-report.c b/device_mapper/libdm-report.c index 6d861fdb4..d6d485964 100644 --- a/device_mapper/libdm-report.c +++ b/device_mapper/libdm-report.c @@ -4107,7 +4107,7 @@ static int _alloc_rh_selection(struct dm_report *rh) static int _report_set_selection(struct dm_report *rh, const char *selection, int add_new_fields) { struct selection_node *root = NULL; - const char *fin, *next; + const char *fin = NULL, *next; if (rh->selection) { if (rh->selection->selection_root) @@ -4127,7 +4127,7 @@ static int _report_set_selection(struct dm_report *rh, const char *selection, in if (!(root = _alloc_selection_node(rh->selection->mem, SEL_OR))) return 0; - if (!_parse_or_ex(rh, selection, &fin, root)) + if (!_parse_or_ex(rh, selection, &fin, root) || !fin) goto_bad; next = _skip_space(fin); diff --git a/libdm/libdm-report.c b/libdm/libdm-report.c index f4d7ee32b..95d5733a2 100644 --- a/libdm/libdm-report.c +++ b/libdm/libdm-report.c @@ -4105,7 +4105,7 @@ static int _alloc_rh_selection(struct dm_report *rh) static int _report_set_selection(struct dm_report *rh, const char *selection, int add_new_fields) { struct selection_node *root = NULL; - const char *fin, *next; + const char *fin = NULL, *next; if (rh->selection) { if (rh->selection->selection_root) @@ -4125,7 +4125,7 @@ static int _report_set_selection(struct dm_report *rh, const char *selection, in if (!(root = _alloc_selection_node(rh->selection->mem, SEL_OR))) return 0; - if (!_parse_or_ex(rh, selection, &fin, root)) + if (!_parse_or_ex(rh, selection, &fin, root) || !fin) goto_bad; next = _skip_space(fin);