mirror of
https://github.com/SagerNet/sing.git
synced 2025-04-03 03:47:38 +03:00
Fix buffer overflow
This commit is contained in:
parent
4e70523360
commit
b2828dac5f
4 changed files with 5 additions and 11 deletions
|
@ -288,10 +288,6 @@ func ReadPacket(conn net.Conn, buffer *buf.Buffer) (M.Socksaddr, error) {
|
|||
return M.Socksaddr{}, E.Cause(err, "read chunk length")
|
||||
}
|
||||
|
||||
if buffer.FreeLen() < int(length) {
|
||||
return M.Socksaddr{}, io.ErrShortBuffer
|
||||
}
|
||||
|
||||
err = rw.SkipN(conn, 2)
|
||||
if err != nil {
|
||||
return M.Socksaddr{}, E.Cause(err, "skip crlf")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue