(t *testing.T)
| 1484 | } |
| 1485 | |
| 1486 | func TestLengthOverflow(t *testing.T) { |
| 1487 | // Overflowing a length should not panic. |
| 1488 | b := protopack.Message{ |
| 1489 | protopack.Tag{2, protopack.BytesType}, protopack.String("\x01"), |
| 1490 | protopack.Tag{3, protopack.BytesType}, protopack.Uvarint(9223372036854775807), |
| 1491 | protopack.Raw("\x01"), |
| 1492 | }.Marshal() |
| 1493 | proto.Unmarshal(b, new(pb2.MyMessage)) |
| 1494 | } |
| 1495 | |
| 1496 | func TestVarintOverflow(t *testing.T) { |
| 1497 | // Overflowing a 64-bit length should not be allowed. |