summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/prometheus/common/expfmt
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2017-07-20 15:22:49 -0700
committerGitHub <noreply@github.com>2017-07-20 15:22:49 -0700
commit58839cefb50e56ae5b157b37e9814ae83ceee70b (patch)
tree5de966481678096fc9567f74f96673b34a65127c /vendor/github.com/prometheus/common/expfmt
parente2f4492eadb5d3c58606b1fdd5774b63a07c236a (diff)
downloadchat-58839cefb50e56ae5b157b37e9814ae83ceee70b.tar.gz
chat-58839cefb50e56ae5b157b37e9814ae83ceee70b.tar.bz2
chat-58839cefb50e56ae5b157b37e9814ae83ceee70b.zip
Upgrading server dependancies (#6984)
Diffstat (limited to 'vendor/github.com/prometheus/common/expfmt')
-rw-r--r--vendor/github.com/prometheus/common/expfmt/text_parse.go4
-rw-r--r--vendor/github.com/prometheus/common/expfmt/text_parse_test.go5
2 files changed, 9 insertions, 0 deletions
diff --git a/vendor/github.com/prometheus/common/expfmt/text_parse.go b/vendor/github.com/prometheus/common/expfmt/text_parse.go
index ef9a15077..54bcfde29 100644
--- a/vendor/github.com/prometheus/common/expfmt/text_parse.go
+++ b/vendor/github.com/prometheus/common/expfmt/text_parse.go
@@ -315,6 +315,10 @@ func (p *TextParser) startLabelValue() stateFn {
if p.readTokenAsLabelValue(); p.err != nil {
return nil
}
+ if !model.LabelValue(p.currentToken.String()).IsValid() {
+ p.parseError(fmt.Sprintf("invalid label value %q", p.currentToken.String()))
+ return nil
+ }
p.currentLabelPair.Value = proto.String(p.currentToken.String())
// Special treatment of summaries:
// - Quantile labels are special, will result in dto.Quantile later.
diff --git a/vendor/github.com/prometheus/common/expfmt/text_parse_test.go b/vendor/github.com/prometheus/common/expfmt/text_parse_test.go
index 7e7388ce9..76c951185 100644
--- a/vendor/github.com/prometheus/common/expfmt/text_parse_test.go
+++ b/vendor/github.com/prometheus/common/expfmt/text_parse_test.go
@@ -559,6 +559,11 @@ metric_bucket{le="bla"} 3.14
`,
err: "text format parsing error in line 3: expected float as value for 'le' label",
},
+ // 19: Invalid UTF-8 in label value.
+ {
+ in: "metric{l=\"\xbd\"} 3.14\n",
+ err: "text format parsing error in line 1: invalid label value \"\\xbd\"",
+ },
}
for i, scenario := range scenarios {