diff --git a/protobuf-nano/src/main/java/io/grpc/protobuf/nano/NanoUtils.java b/protobuf-nano/src/main/java/io/grpc/protobuf/nano/NanoUtils.java index 300f50c522..9375fc8df9 100644 --- a/protobuf-nano/src/main/java/io/grpc/protobuf/nano/NanoUtils.java +++ b/protobuf-nano/src/main/java/io/grpc/protobuf/nano/NanoUtils.java @@ -62,6 +62,7 @@ public class NanoUtils { // TODO(simonma): Investigate whether we can do 0-copy here. CodedInputByteBufferNano input = CodedInputByteBufferNano.newInstance(ByteStreams.toByteArray(stream)); + input.setSizeLimit(Integer.MAX_VALUE); return parser.parse(input); } catch (IOException ipbe) { throw Status.INTERNAL.withDescription("Failed parsing nano proto message").withCause(ipbe)