fairyhawk / protostuff

Automatically exported from code.google.com/p/protostuff
Apache License 2.0
0 stars 0 forks source link

CodedInput#skipRawBytes() fails some times for streamed parsing #147

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I have attached a small maven project containing a sample protobuf object as 
well as a test that shows a case where the CodedInput fails to parse a message.

This bug will always happen if the message contains a field not known to the 
schema which will try to skip it and the skipped amount of bytes exceeds the 
currently loaded amount of bytes in the buffer.

I was able to fix the issue by changing line 925 of the CodedInput (version 
1.0.7) as follows:
-totalBytesRetired += pos;
+totalBytesRetired += bufferSize;

Please let me know if you need further information.

Original issue reported on code.google.com by chri...@gmx.de on 11 Sep 2013 at 5:57

Attachments:

GoogleCodeExporter commented 8 years ago
Tried it with 1.0.8-SNAPSHOT and it was already fixed from issue 138.
The thing that sucks is that I haven't release 1.0.8. (bad maintainer = me)
Sorry for the trouble.

Original comment by david.yu...@gmail.com on 11 Sep 2013 at 6:28

GoogleCodeExporter commented 8 years ago
Ah ok cool - I just scanned the open tickets for a duplicate and overlooked the 
fixed ones ...

Original comment by chri...@gmx.de on 11 Sep 2013 at 6:59