You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@thrift.apache.org by "fishy (via GitHub)" <gi...@apache.org> on 2025/05/28 20:30:26 UTC

Re: [PR] [THRIFT-5871] Improve MAX_MESSAGE_SIZE_CHECK and friends [thrift]

fishy commented on code in PR #3151:
URL: https://github.com/apache/thrift/pull/3151#discussion_r2112696805


##########
lib/go/thrift/json_protocol.go:
##########
@@ -314,11 +314,14 @@ func (p *TJSONProtocol) ReadMapBegin(ctx context.Context) (keyType TType, valueT
 	if err != nil {
 		return keyType, valueType, size, err
 	}
-	err = checkSizeForProtocol(int32(iSize), p.cfg)
+	size = int(iSize)
+
+	minElemSize := p.getMinSerializedSize(keyType) + p.getMinSerializedSize(valueType)

Review Comment:
   for json map, there's at least another `+1` for the `:`, I think? not that that's super important though.



-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@thrift.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org