shiyilei / protobuf-c

Automatically exported from code.google.com/p/protobuf-c
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Using negative number for first example causes unterminated variant at offset 1 #56

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Use example 1 - amessage_serialize -1 -1 | amessage_deserialize 
2. Error on deserialize (unterminated varint at offset 1)
3. Seen on MAC

What is the expected output? What do you see instead?
Received: a=-1 b=-1

What version of the product are you using? On what operating system?
MAC OS/X 10.6 with protobuf-2.3.0 and protobuf-c-0.14

Please provide any additional information below.

Original issue reported on code.google.com by mark.r....@gmail.com on 9 Jan 2011 at 11:51

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
I used the example code which uses "fgetc" to read from the input stream in a 
while loop until an "EOF" is reached. However, this doesn't work for binary 
data. So I used "fread" on a file opened with binary mode which finally worked. 
So maybe you did the same thing...?

Original comment by jonny.de...@gmail.com on 6 Mar 2011 at 12:36

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Thanks Jonny.  Recreated problem on MAC OS/X and corrected examples on site 
using fread on stdin.  Please email any other example sets you may have, and I 
will validate and place on site for others.

The issue stands corrected and was not against the protobuf-c code source.

Original comment by mark.r....@gmail.com on 7 Mar 2011 at 3:51

GoogleCodeExporter commented 8 years ago

Original comment by lahike...@gmail.com on 10 Mar 2011 at 10:41