mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-23 20:37:12 +01:00
lib/storage: properly set buf capacity inside marshalMetricID
Previously it was always set to 0. In theory this could result into incorrect marshaling
of metricIDs.
The issue has been introduced in 5e4dfe50c6
This commit is contained in:
parent
4cb83f0f4a
commit
057fb2120b
@ -443,8 +443,8 @@ func marshalMetricIDs(dst []byte, metricIDs []uint64) []byte {
|
||||
var buf []byte
|
||||
sh := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
|
||||
sh.Data = uintptr(unsafe.Pointer(&metricIDs[0]))
|
||||
sh.Cap = sh.Len
|
||||
sh.Len = 8 * len(metricIDs)
|
||||
sh.Cap = 8 * len(metricIDs)
|
||||
sh.Len = sh.Cap
|
||||
dst = append(dst, buf...)
|
||||
return dst
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user