Skip to content

Commit

Permalink
+1 to ensured length to account for for colon added to cat-only tags
Browse files Browse the repository at this point in the history
no need to get the encode(decode) length because they are inverse operations
  • Loading branch information
RobBoeckermann committed May 30, 2023
1 parent 69adbd9 commit 2831e01
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/noit_message_decoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -484,8 +484,7 @@ const char *noit_metric_tags_parse_one_implicit(const char *const tagnm, const s
static int tag_canonical_size(noit_metric_tag_t *tag) {
mtev_dyn_buffer_t dbuff;
mtev_dyn_buffer_init(&dbuff);
const size_t max_ensured_len =
mtev_b64_encode_len(mtev_b64_max_decode_len(tag->total_size));
const size_t max_ensured_len = tag->total_size + 1; //+1 for colon added to cat-only tags
mtev_dyn_buffer_ensure(&dbuff, max_ensured_len);
int len =
noit_metric_tagset_decode_tag((char *)mtev_dyn_buffer_data(&dbuff),
Expand Down

0 comments on commit 2831e01

Please sign in to comment.