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

Duplicate key allowed in inline table inside an array #662

Closed
moorereason opened this issue Nov 9, 2021 · 2 comments
Closed

Duplicate key allowed in inline table inside an array #662

moorereason opened this issue Nov 9, 2021 · 2 comments
Labels
bug Issues describing a bug in go-toml. v2 Issues impacting the v2 major version.
Milestone

Comments

@moorereason
Copy link
Contributor

Describe the bug
Similar to #658

Given a=[{b=1,b=2}], go-toml returns the following (using gotoml-test-decoder):

{
  "a": [
    {
      "b": {
        "type": "integer",
        "value": "2"
      }
    }
  ]
}

To Reproduce
https://play.golang.org/p/DxoAkvnWJLI

toml.Unmarshal([]byte("a=[{b=1,b=2}]"), &v)

Expected behavior
I expected an error about duplicate keys within the inline table.

Versions

  • go-toml: 6445159
  • go version go1.17.1 linux/amd64

Additional context
Found while doing differential fuzzing against BurnstSushi.

@pelletier pelletier added bug Issues describing a bug in go-toml. v2 Issues impacting the v2 major version. labels Nov 10, 2021
@pelletier pelletier added this to the v2.0.0-beta.5 milestone Nov 10, 2021
pelletier added a commit that referenced this issue Nov 10, 2021
pelletier added a commit that referenced this issue Nov 10, 2021
@pelletier
Copy link
Owner

Should be fixed by f27a07d. As far as I know only inline tables and arrays are containers in values, so that should be the end of it 😅

@moorereason
Copy link
Contributor Author

If not, the fuzzer will probably find it! 😄

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. v2 Issues impacting the v2 major version.
Projects
None yet
Development

No branches or pull requests

2 participants