Browse Source

Set reserved to zero after Read()

Thank @IRN-Kawakaze for testing
RPRX 2 years ago
parent
commit
4c8ee0af50
1 changed files with 7 additions and 0 deletions
  1. 7 0
      proxy/wireguard/bind.go

+ 7 - 0
proxy/wireguard/bind.go

@@ -129,6 +129,13 @@ func (bind *netBindClient) connectTo(endpoint *netEndpoint) error {
 				return
 			}
 			i, err := c.Read(v.buff)
+
+			if i > 3 {
+				v.buff[1] = 0
+				v.buff[2] = 0
+				v.buff[3] = 0
+			}
+
 			v.bytes = i
 			v.endpoint = endpoint
 			v.err = err