mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2025-01-10 15:14:09 +00: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
2fad03d85e
commit
512c73cef9
1 changed files with 2 additions and 2 deletions
|
@ -456,8 +456,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 a new issue