regex match: Fix unexpected match with empty meta data
authorTakuro Ashie <ashie@clear-code.com>
Tue, 18 Jun 2019 06:54:51 +0000 (15:54 +0900)
committerMatthias Runge <mrunge@redhat.com>
Tue, 2 Jul 2019 09:34:50 +0000 (11:34 +0200)
commit04ddb9fa96ed0bdfdfe0b24e78516d03c7def86c
tree6e59bfbaf031174c273206eb05309983d7b131d3
parent55fb4dfbd1b3f718468152807594b7eeb24d8918
regex match: Fix unexpected match with empty meta data

If a user set

  MetaData "foo" "bar"

and a metric does not have meta data (vl->meta == NULL), it causes
unexpected match.

Existance of MetaData config should be checked before meta data in
a metric.

See also: #1930

Signed-off-by: Takuro Ashie <ashie@clear-code.com>
(cherry picked from commit d4f53887527777296b0982af60f4c0fecdb2f0d9)
src/match_regex.c