fishy commented on a change in pull request #2296:
URL: https://github.com/apache/thrift/pull/2296#discussion_r548053200



##########
File path: lib/go/thrift/framed_transport.go
##########
@@ -155,7 +189,7 @@ func (p *TFramedTransport) readFrame() error {
                return err
        }
        size := binary.BigEndian.Uint32(buf)
-       if size < 0 || size > p.maxLength {
+       if size < 0 || size > uint32(p.cfg.GetMaxFrameSize()) {

Review comment:
       Before `p.maxLength` actually has the type of `uint32` instead of 
`int32`.
   
   To become negative when converting to `int32` the `uint32` value needs to be 
at least 2GB (MaxInt32 is `1<<31-1`). I'm not sure how much do we really care 
about that use case. If we do care about it I can change the types of 
`MaxMessageSize` and `MaxFrameSize` both from `int32` to `uint32`.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to