pelletier / go-toml

Go library for the TOML file format
https://github.com/pelletier/go-toml
Other
1.7k stars 209 forks source link

🔒 Fuzzing setup and fixes #754

Closed pelletier closed 2 years ago

pelletier commented 2 years ago

Finding and fixing bugs in the encoder with Go 1.18 fuzzing.

moorereason commented 2 years ago

Why do you not allow fuzzing on Windows?

pelletier commented 2 years ago

@moorereason the Go fuzz runner seems to be failing for some internal reason on windows. Figured I’d block it until I can figure out what’s wrong there.

moorereason commented 2 years ago

I tested the Windows fuzzing piece and opened golang/go#52268.

The work-around is some form of these Git settings:

git clone https://github.com/pelletier/go-toml.git --config core.autocrlf=false --config core.eol=lf
moorereason commented 2 years ago

Also, please keep this fixes branch around for a while since I reference it in the upstream issue.

pelletier commented 2 years ago

Cool! Thank you for looking into this. I've added branch protection on this one to make sure it does not go away. Creating a new PR to get those fixes in. I'll try to play with .gitattributes to see if this issue can be worked-around.

pelletier commented 2 years ago

Confirmed that adding an entry to .gitattributes works: https://github.com/pelletier/go-toml/pull/755/commits/bb2fabec9cbb30fd626640d4c5eb2568ba0aae7c.

pelletier commented 2 years ago

@moorereason since https://github.com/golang/go/issues/52268 has been closed, mind if I close this one and delete the branch too?

moorereason commented 2 years ago

Agreed