diff options
author | Ilya Mashchenko <ilya@netdata.cloud> | 2023-06-01 20:40:23 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-01 20:40:23 +0300 |
commit | a1c1f8f3abc1fd547f4996dee2d2ee587b98c0c3 (patch) | |
tree | 3e2f760d4908c40066d6b81fac9197380ea51b88 /database | |
parent | 5e0212919cd60493bf2d3716739fdf08ad0830f9 (diff) |
fix: allow square brackets in label value (#15131)
Diffstat (limited to 'database')
-rw-r--r-- | database/rrdlabels.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/database/rrdlabels.c b/database/rrdlabels.c index f6abd60232..051222109f 100644 --- a/database/rrdlabels.c +++ b/database/rrdlabels.c @@ -153,9 +153,9 @@ static unsigned char label_values_char_map[256] = { [88] = 'X', // X keep [89] = 'Y', // Y keep [90] = 'Z', // Z keep - [91] = '_', // [ + [91] = '[', // [ keep [92] = '/', // backslash convert \ to / - [93] = '_', // ] + [93] = ']', // ] keep [94] = '_', // ^ [95] = '_', // _ keep [96] = '_', // ` @@ -1223,6 +1223,7 @@ int rrdlabels_unittest_sanitization() { errors += rrdlabels_unittest_sanitize_value("", "[none]"); errors += rrdlabels_unittest_sanitize_value("1", "1"); errors += rrdlabels_unittest_sanitize_value(" hello world ", "hello world"); + errors += rrdlabels_unittest_sanitize_value("[none]", "[none]"); // 2-byte UTF-8 errors += rrdlabels_unittest_sanitize_value(" Ελλάδα ", "Ελλάδα"); |