-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dialer conn: decode packet 3: varint overflows integer #234
Comments
|
The entire |
After some debugging in the Discord server, a "patch" got written: (of course this would have to be copied onto other types as well) func (r *Reader) Varuint32(x *uint32) {
var v uint32
+ var i int
- for i := 0; i < 35; i += 7 {
+ for {
b, err := r.r.ReadByte()
if err != nil {
r.panic(err)
}
v |= uint32(b&0x7f) << i
if b&0x80 == 0 {
*x = v
return
}
+ i += 7
}
- r.panic(errVarIntOverflow)
} It turns out the client won't stop reading until it gets to the "end". |
some servers (ex: skill-mine.ru:19133) send invalid varints on purpose, preventing anyone using gophertunnel to join their servers
when removing the panic:
The text was updated successfully, but these errors were encountered: