plutoo / protobuf-csharp-port

Automatically exported from code.google.com/p/protobuf-csharp-port
Other
0 stars 0 forks source link

Incorrect Position returned from new CodedInputStream.Position property #55

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a CodedInputStream on a System.Stream object.
2. Read a length delimited prefix
2. Call CodedInputStream.PushLimit(0)
3. Position property returns incorrect value

What is the expected output? What do you see instead?

The bufferSizeAfterLimit field should be taken into account when computing the 
stream offset.

The following change should be applied to address the issue.

    get
    {
        if (input != null)
-           return input.Position - (bufferSize - bufferPos);
+           return input.Position - ((bufferSize + bufferSizeAfterLimit) - 
bufferPos);
        return bufferPos;
    }

Original issue reported on code.google.com by Grig...@gmail.com on 16 May 2013 at 7:28

GoogleCodeExporter commented 9 years ago
Fixed in rev 666b93be488e

Original comment by Grig...@gmail.com on 21 Sep 2013 at 5:55