decred / dcrd

Decred daemon in Go (golang).
https://decred.org
ISC License
731 stars 289 forks source link

mixclient: Dont append to slice with non-zero length. #3397

Closed jholdstock closed 1 month ago

jholdstock commented 1 month ago

Immediately appending to a slice initialized with a non-zero length will lead to a slice which is twice as large as intended, with the initial half of the entries being left at their zero value.

This is fixed by initializing the slice with capacity instead of length.