forked from quic-go/quic-go
prevent int64 overflow when reading the expiry date of the server config
This commit is contained in:
@@ -235,6 +235,13 @@ var _ = Describe("Server Config", func() {
|
||||
err := scfg.parseValues(tagMap)
|
||||
Expect(err).To(MatchError("CryptoInvalidValueLength: EXPY"))
|
||||
})
|
||||
|
||||
It("deals with absurdly large timestamps", func() {
|
||||
tagMap[TagEXPY] = bytes.Repeat([]byte{0xff}, 8) // this would overflow the int64
|
||||
err := scfg.parseValues(tagMap)
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
Expect(scfg.expiry.After(time.Now())).To(BeTrue())
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user