Skip to content

time: RFC3339 time.Parse can not parse string that come from time.Format #20555

Closed as not planned
@bronze1man

Description

@bronze1man

Please answer these questions before submitting your issue. Thanks!

What did you do?

ttps://play.golang.org/p/BItq172M-_
The bad time string "0007-05-31T3:50:00+99:80"

What did you expect to see?

0001-01-01 00:00:00 +0000 UTC xxx some error

What did you see instead?

0007-05-31 03:50:00 +10020 +10020 <nil>
0007-05-31T03:50:00+100:20
0001-01-01 00:00:00 +0000 UTC parsing time "0007-05-31T03:50:00+100:20" as "2006-01-02T15:04:05Z07:00": cannot parse "+100:20" as "Z07:00"

Because the RFC3339 parse/format is using in json.
This may curse some crashes with special user input and developer assumes that json.Unmarshal is not return an error equals to json.Unmarshal/json.Marshal/json.Unmarshal will not return an error

This string is found by using https://github.com/dvyukov/go-fuzz

Metadata

Metadata

Assignees

No one assigned

    Labels

    NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.v2An incompatible library change

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions