Remove size restriction when parsing nano protos

This commit is contained in:
Xudong Ma 2015-08-24 10:53:52 -07:00
parent 345773504c
commit 76b410de39
1 changed files with 1 additions and 0 deletions

View File

@ -62,6 +62,7 @@ public class NanoUtils {
// TODO(simonma): Investigate whether we can do 0-copy here. // TODO(simonma): Investigate whether we can do 0-copy here.
CodedInputByteBufferNano input = CodedInputByteBufferNano input =
CodedInputByteBufferNano.newInstance(ByteStreams.toByteArray(stream)); CodedInputByteBufferNano.newInstance(ByteStreams.toByteArray(stream));
input.setSizeLimit(Integer.MAX_VALUE);
return parser.parse(input); return parser.parse(input);
} catch (IOException ipbe) { } catch (IOException ipbe) {
throw Status.INTERNAL.withDescription("Failed parsing nano proto message").withCause(ipbe) throw Status.INTERNAL.withDescription("Failed parsing nano proto message").withCause(ipbe)