Browse Source

Fix websocket crash

世界 7 months ago
parent
commit
ae8ce75e41
1 changed files with 4 additions and 0 deletions
  1. 4 0
      transport/v2raywebsocket/conn.go

+ 4 - 0
transport/v2raywebsocket/conn.go

@@ -74,6 +74,10 @@ func (c *WebsocketConn) Read(b []byte) (n int, err error) {
 			return
 		}
 		if header.OpCode.IsControl() {
+			if header.Length > 128 {
+				err = wsutil.ErrFrameTooLarge
+				return
+			}
 			err = c.controlHandler(header, c.reader)
 			if err != nil {
 				return