cosmos-sdk/math
Emmanuel T Odeke b2af716bf7
math: derive marshalled byte length from copy, not blind assumptions (#12010)
The specification of "copy", the builtin function per
https://pkg.go.dev/builtin#copy, says that it returns the minimum of
len(src) and len(dst) when invoked as:

   copy(dst, src)

of which the prior code blindly assumed that everytime that
copy is invoked that the buffer provided had enough size
to accomodate the contents of *.MarshalTo but this isn't true
at all if len(data) is less than the values of .Marshal()
2022-05-23 12:08:11 +02:00
..
CHANGELOG.md refactor!: create math go sub module (#11788) 2022-04-28 14:05:21 -04:00
doc.go refactor!: create math go sub module (#11788) 2022-04-28 14:05:21 -04:00
go.mod chore: update module path for math module (#11821) 2022-04-29 10:02:55 -04:00
go.sum refactor!: create math go sub module (#11788) 2022-04-28 14:05:21 -04:00
int.go math: derive marshalled byte length from copy, not blind assumptions (#12010) 2022-05-23 12:08:11 +02:00
int_internal_test.go refactor!: create math go sub module (#11788) 2022-04-28 14:05:21 -04:00
int_test.go chore: gofumpt (#11839) 2022-05-19 10:55:27 +02:00
proto.go refactor!: create math go sub module (#11788) 2022-04-28 14:05:21 -04:00
uint.go math: derive marshalled byte length from copy, not blind assumptions (#12010) 2022-05-23 12:08:11 +02:00
uint_internal_test.go chore: gofumpt (#11839) 2022-05-19 10:55:27 +02:00
uint_test.go fix: math: fix Uint.Unmarshal's lack of negative value checking (#11996) 2022-05-19 20:28:06 +00:00