You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
toml.Unmarshal([]byte("# this is a test\ra=1"), &v)
Or with the toml-test decoder:
$ echo "# this is a test\ra=1" | toml-test-decoder2
{
"a": {
"type": "integer",
"value": "1"
}
}
Expectation
I would expect an error. \r is not an allowed control character for a comment. Without an trailing line feed (\n), it should not be considered a newline sequence (\r\n).
I found this issue while doing differential fuzzing against go-toml. Interestingly, go-toml also doesn't return an error, but it does treat the whole line as a comment.
The text was updated successfully, but these errors were encountered:
Given the input
# this is a test\ra=1
, this package decodes the input asa=1
.Reproduction
https://play.golang.org/p/YhQC0y2Dd5w
Or with the
toml-test
decoder:Expectation
I would expect an error.
\r
is not an allowed control character for a comment. Without an trailing line feed (\n
), it should not be considered a newline sequence (\r\n
).I found this issue while doing differential fuzzing against
go-toml
. Interestingly,go-toml
also doesn't return an error, but it does treat the whole line as a comment.The text was updated successfully, but these errors were encountered: