Skip to content
This repository was archived by the owner on Apr 3, 2021. It is now read-only.

Commit d42eac8

Browse files
author
ghost
committed
Fix buffer bounding
fix #116
1 parent 7492950 commit d42eac8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

proxy/socks/udp.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,10 @@ func (h *udpHandler) fetchUDPInput(conn core.UDPConn, input net.PacketConn) {
6767
if err != nil {
6868
return
6969
}
70-
if len(buf) < 3 {
70+
if n < 3 {
7171
return
7272
}
73-
addr := SplitAddr(buf[3:])
73+
addr := SplitAddr(buf[3:n])
7474
if addr == nil {
7575
return
7676
}

0 commit comments

Comments
 (0)