Skip to content
New issue

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

Detect leading zero on positive float #734

Closed
moorereason opened this issue Jan 6, 2022 · 1 comment
Closed

Detect leading zero on positive float #734

moorereason opened this issue Jan 6, 2022 · 1 comment
Labels
bug Issues describing a bug in go-toml.

Comments

@moorereason
Copy link
Contributor

Describe the bug
Given a float such as 0=+0_0.0, go-toml accepts the input as valid.

$ echo -n "0=+0_0.0" | gotoml-test-decoder
{
  "0": {
    "type": "float",
    "value": "0"
  }
}

To Reproduce
https://go.dev/play/p/EDKOatLs5WA

toml.Unmarshal([]byte("0=+0_0.0"), &v)

Expected behavior
Expected to see an error about leading zero on a float number.

Versions

  • go-toml: v2 e83cf53
  • go version go1.17.5 linux/amd64

Additional context
Found while doing differential fuzzing against tomlplusplus/v3.

@pelletier
Copy link
Owner

Thanks!

@pelletier pelletier added the bug Issues describing a bug in go-toml. label Jan 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues describing a bug in go-toml.
Projects
None yet
Development

No branches or pull requests

2 participants