-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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()
- Loading branch information
Showing
2 changed files
with
8 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters