Decoder: check tz has : between hours and minutes (#691)

Fixes #690
This commit is contained in:
Thomas Pelletier
2021-11-30 20:22:11 -05:00
committed by GitHub
parent 4c7a337083
commit 3990899d7e
2 changed files with 8 additions and 0 deletions
+4
View File
@@ -109,6 +109,10 @@ func parseDateTime(b []byte) (time.Time, error) {
return time.Time{}, newDecodeError(b[:1], "invalid timezone offset character")
}
if b[3] != ':' {
return time.Time{}, newDecodeError(b[3:4], "expected a : separator")
}
hours := digitsToInt(b[1:3])
minutes := digitsToInt(b[4:6])
seconds := direction * (hours*3600 + minutes*60)
+4
View File
@@ -2632,6 +2632,10 @@ world'`,
desc: `invalid number of seconds digits with trailing digit`,
data: `a=0000-01-01 00:00:000000Z3`,
},
{
desc: `invalid number of seconds`,
data: `a=0000-01-01 00:00:00+27000`,
},
{
desc: `carriage return inside basic key`,
data: "\"\r\"=42",