]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
stats: Fail to load with empty metric filters
authorJosef 'Jeff' Sipek <jeff.sipek@open-xchange.com>
Mon, 11 May 2020 18:43:15 +0000 (14:43 -0400)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Fri, 26 Jun 2020 07:18:18 +0000 (07:18 +0000)
src/stats/stats-settings.c

index b9ae1decca10d4c3d83b88aa2872106c50e82a5c..b7879332cf359e1fb30e2c27ef2895529e8ee4b1 100644 (file)
@@ -481,6 +481,12 @@ static bool stats_metric_settings_check(void *_set, pool_t pool, const char **er
                return FALSE;
        }
 
+       if (set->filter[0] == '\0') {
+               *error_r = t_strdup_printf("metric %s { filter } is empty - "
+                                          "will not match anything", set->metric_name);
+               return FALSE;
+       }
+
        set->parsed_filter = event_filter_create_fragment(pool);
        if (event_filter_parse(set->filter, set->parsed_filter, error_r) < 0)
                return FALSE;