Skip to content

Commit

Permalink
fix overflow attack
Browse files Browse the repository at this point in the history
  • Loading branch information
mengskysama committed Mar 17, 2020
1 parent 519eac6 commit d83db69
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion api/comet/grpc/protocol.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ func (p *Proto) ReadWebsocket(ws *websocket.Conn) (err error) {
p.Ver = int32(binary.BigEndian.Int16(buf[_verOffset:_opOffset]))
p.Op = binary.BigEndian.Int32(buf[_opOffset:_seqOffset])
p.Seq = binary.BigEndian.Int32(buf[_seqOffset:])
if packLen > _maxPackSize {
if packLen < 0 || packLen > _maxPackSize {
return ErrProtoPackLen
}
if headerLen != _rawHeaderSize {
Expand Down

0 comments on commit d83db69

Please sign in to comment.