mirror of
https://github.com/fatedier/frp.git
synced 2026-05-21 06:45:32 -06:00
models/msg: limit single package length
This commit is contained in:
parent
3b06d771ac
commit
1da81ad7d3
1 changed files with 5 additions and 0 deletions
|
|
@ -146,6 +146,11 @@ func pipeDecrypt(r *conn.Conn, w *conn.Conn, conf config.BaseConf, needRecord bo
|
|||
}
|
||||
cnt, res, left = unpkgMsg(newBuf)
|
||||
if cnt < 0 {
|
||||
// limit one package length, maximum is 1MB
|
||||
if len(res) > 1024*1024 {
|
||||
log.Warn("ProxyName [%s], package length exceeds the limit")
|
||||
return fmt.Errorf("package length error")
|
||||
}
|
||||
continue
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue