parser: don't overflow when parsing bad times (#593)

Fixes #585
This commit is contained in:
Thomas Pelletier
2021-09-09 11:59:37 -04:00
committed by GitHub
parent f34c9c332f
commit fa56f48daf
2 changed files with 11 additions and 0 deletions
+6
View File
@@ -1746,6 +1746,12 @@ func TestIssue588(t *testing.T) {
require.Error(t, err)
}
func TestIssue585(t *testing.T) {
var v interface{}
err := toml.Unmarshal([]byte(`a=1979-05127T 0`), &v)
require.Error(t, err)
}
//nolint:funlen
func TestUnmarshalDecodeErrors(t *testing.T) {
examples := []struct {