Ever since ReadUvarint was modified in #41185 to limit reading to only 10 bytes, this made it such that Uvarint and ReadUvarint disagree about the definition of a varint. We should put the 10-byte limit in Uvarint as well and treat it as an overflow condition. This can occur for denormalized varints where a small integer uses more bytes to encode than necessary.
For comparison, protowire.ConsumeVarint holds to the stricter definition of a varint where it only handles up to 10 bytes and then treats any additional bytes as an overflow condition.
The text was updated successfully, but these errors were encountered:
Ever since
ReadUvarint
was modified in #41185 to limit reading to only 10 bytes, this made it such thatUvarint
andReadUvarint
disagree about the definition of a varint. We should put the 10-byte limit in Uvarint as well and treat it as an overflow condition. This can occur for denormalized varints where a small integer uses more bytes to encode than necessary.For comparison,
protowire.ConsumeVarint
holds to the stricter definition of a varint where it only handles up to 10 bytes and then treats any additional bytes as an overflow condition.The text was updated successfully, but these errors were encountered: