Skip to content

Commit

Permalink
app/vmselect/promql: do not use unsafe conversion from bytes slice to…
Browse files Browse the repository at this point in the history
… string when storing a value by map key

The assigned map key shouldn't change over time, otherwise the map won't work properly.

This is a follow-up for 1f91f22
Updates VictoriaMetrics#5087
  • Loading branch information
valyala authored and Andrew Chubatiuk committed Nov 15, 2023
1 parent 1538764 commit 96c3c05
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/vmselect/promql/transform.go
Expand Up @@ -420,7 +420,7 @@ func transformBucketsLimit(tfa *transformFuncArg) ([]*timeseries, error) {
mn.CopyFrom(&ts.MetricName)
mn.RemoveTag("le")
b = marshalMetricNameSorted(b[:0], &mn)
k := bytesutil.ToUnsafeString(b)
k := string(b)
m[k] = append(m[k], x{
le: le,
ts: ts,
Expand Down

0 comments on commit 96c3c05

Please sign in to comment.