Skip to content

Commit

Permalink
keep the overflowed value for little endian
Browse files Browse the repository at this point in the history
  • Loading branch information
dmathieu committed Dec 12, 2024
1 parent a6ba756 commit b250f87
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions exporter/elasticsearchexporter/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -986,11 +986,7 @@ func valueHash(h hash.Hash, v pcommon.Value) {
h.Write(buf)
case pcommon.ValueTypeInt:
buf := make([]byte, 8)
var i uint64
if v.Int() > 0 {
i = uint64(v.Int()) //nolint:gosec // overflow checked
}
binary.LittleEndian.PutUint64(buf, i)
binary.LittleEndian.PutUint64(buf, uint64(v.Int())) // nolint:gosec // overflow assumed. We prefer having high integers than zero.
h.Write(buf)
case pcommon.ValueTypeBytes:
h.Write(v.Bytes().AsRaw())
Expand Down

0 comments on commit b250f87

Please sign in to comment.