decode: fix maximum time offset values (#706)
According to RFC3339 section 5.6, the maximum time offset values for hours and minutes is 23 and 59, respectively.
This commit is contained in:
@@ -117,7 +117,7 @@ func parseDateTime(b []byte) (time.Time, error) {
|
||||
if err != nil {
|
||||
return time.Time{}, err
|
||||
}
|
||||
if hours > 24 {
|
||||
if hours > 23 {
|
||||
return time.Time{}, newDecodeError(b[:1], "invalid timezone offset hours")
|
||||
}
|
||||
|
||||
@@ -125,7 +125,7 @@ func parseDateTime(b []byte) (time.Time, error) {
|
||||
if err != nil {
|
||||
return time.Time{}, err
|
||||
}
|
||||
if minutes > 60 {
|
||||
if minutes > 59 {
|
||||
return time.Time{}, newDecodeError(b[:1], "invalid timezone offset minutes")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user