We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v2.5.0
Yes.
go env
$ go env
Marshaled RawMessage([]byte{0xa6}) without error, then called Wellformed on the output.
RawMessage([]byte{0xa6})
Wellformed
https://go.dev/play/p/n_OxskfI3oA
I expected the call to Marshal to return a non-nil error refusing to output malformed CBOR.
The Marshaler (in this case a RawMessage) is trusted to produce well-formed CBOR, and as a result the output from Marshal is not well-formed.
RawMessage
The text was updated successfully, but these errors were encountered:
@benluddy Thanks for finding and reporting this bug! 👍
I'll open a PR to fix this by rejecting malformed CBOR data from Marshaler.
Marshaler
Sorry, something went wrong.
ByteSliceMode
fxamacker
Successfully merging a pull request may close this issue.
What version of fxamacker/cbor are you using?
v2.5.0
Does this issue reproduce with the latest release?
Yes.
What OS and CPU architecture are you using (
go env
)?go env
OutputWhat did you do?
Marshaled
RawMessage([]byte{0xa6})
without error, then calledWellformed
on the output.https://go.dev/play/p/n_OxskfI3oA
What did you expect to see?
I expected the call to Marshal to return a non-nil error refusing to output malformed CBOR.
What did you see instead?
The Marshaler (in this case a
RawMessage
) is trusted to produce well-formed CBOR, and as a result the output from Marshal is not well-formed.The text was updated successfully, but these errors were encountered: