Closed moorereason closed 2 years ago
Describe the bug Given 0=0000-01-01 00:00:00+27000, go-toml doesn't return an error on the time zone offset.
0=0000-01-01 00:00:00+27000
$ echo "0=0000-01-01 00:00:00+27000" | gotoml-test-decoder { "0": { "type": "datetime", "value": "0000-01-01T00:00:00+27:00" } }
To Reproduce https://go.dev/play/p/fES37UrI64-
toml.Unmarshal([]byte("0=0000-01-01 00:00:00+27000"), &v)
Expected behavior I expected to see an error on invalid time zone offset since it has 5 digits instead of the max of 4. Per RFC3339/ISO8601 ABNF:
time-hour = 2DIGIT ; 00-24 time-minute = 2DIGIT ; 00-59 time-numoffset = ("+" / "-") time-hour [[":"] time-minute]
Versions
Additional context Found while doing differential fuzzing against toml-dart.
toml-dart
Should be fixed in https://github.com/pelletier/go-toml/commit/3990899d7eec45790be0f4a5344e387a89098181.
Describe the bug Given
0=0000-01-01 00:00:00+27000
, go-toml doesn't return an error on the time zone offset.To Reproduce https://go.dev/play/p/fES37UrI64-
Expected behavior I expected to see an error on invalid time zone offset since it has 5 digits instead of the max of 4. Per RFC3339/ISO8601 ABNF:
Versions
Additional context Found while doing differential fuzzing against
toml-dart
.