Exploit databaseDownload repository ZIP
GH-86eeaf4efa344024f10caaad61672e6a
neex/hui2ochko
Sources for CVE-2021-43848
1 sourcePreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars.
Repository files28
neex/hui2ochkoRevision 8c5ba6085431
- ↑..Parent directory
- linkedlist/
- atomic_bool.go
- atomic_bool_test.go
- buffered_write_closer.go
- buffered_write_closer_test.go
- byteinterval_linkedlist.go
- byteoder_big_endian_test.go
- byteorder.go
- byteorder_big_endian.go
- gen.go
- ip.go
- ip_test.go
- log.go
- log_test.go
- minmax.go
- minmax_test.go
- new_connection_id.go
- newconnectionid_linkedlist.go
- packet_interval.go
- packetinterval_linkedlist.go
- rand.go
- rand_test.go
- rtt_stats.go
- rtt_stats_test.go
- streamframe_interval.go
- timer.go
- timer_test.go
- utils_suite_test.go
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
patched-quic-go/internal_/utils/timer.go
Go · 1,097 bytespackage utils
import (
"math"
"time"
)
// A Timer wrapper that behaves correctly when resetting
type Timer struct {
t *time.Timer
read bool
deadline time.Time
}
// NewTimer creates a new timer that is not set
func NewTimer() *Timer {
return &Timer{t: time.NewTimer(time.Duration(math.MaxInt64))}
}
// Chan returns the channel of the wrapped timer
func (t *Timer) Chan() <-chan time.Time {
return t.t.C
}
// Reset the timer, no matter whether the value was read or not
func (t *Timer) Reset(deadline time.Time) {
if deadline.Equal(t.deadline) && !t.read {
// No need to reset the timer
return
}
// We need to drain the timer if the value from its channel was not read yet.
// See https://groups.google.com/forum/#!topic/golang-dev/c9UUfASVPoU
if !t.t.Stop() && !t.read {
<-t.t.C
}
if !deadline.IsZero() {
t.t.Reset(time.Until(deadline))
}
t.read = false
t.deadline = deadline
}
// SetRead should be called after the value from the chan was read
func (t *Timer) SetRead() {
t.read = true
}
// Stop stops the timer
func (t *Timer) Stop() {
t.t.Stop()
}