Skip to content

Commit

Permalink
Merge pull request #5 from number571/master
Browse files Browse the repository at this point in the history
Fix udp ReadFrom
  • Loading branch information
wzshiming committed Oct 19, 2023
2 parents a56634f + 1daacd4 commit 0e66f80
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion udp.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func (c *UDPConn) ReadFrom(p []byte) (n int, addr net.Addr, err error) {
if n < len(c.prefix) || addr.String() != c.proxyAddress.String() {
return 0, nil, errBadHeader
}
buf := bytes.NewBuffer(c.bufRead[len(c.prefix):])
buf := bytes.NewBuffer(c.bufRead[len(c.prefix):n])
a, err := readAddr(buf)
if err != nil {
return 0, nil, err
Expand Down

0 comments on commit 0e66f80

Please sign in to comment.