aboutsummaryrefslogtreecommitdiff
path: root/csharp/src/Google.Protobuf/CodedInputStream.cs
diff options
context:
space:
mode:
Diffstat (limited to 'csharp/src/Google.Protobuf/CodedInputStream.cs')
-rw-r--r--csharp/src/Google.Protobuf/CodedInputStream.cs4
1 files changed, 2 insertions, 2 deletions
diff --git a/csharp/src/Google.Protobuf/CodedInputStream.cs b/csharp/src/Google.Protobuf/CodedInputStream.cs
index 84f90a25..abd352b9 100644
--- a/csharp/src/Google.Protobuf/CodedInputStream.cs
+++ b/csharp/src/Google.Protobuf/CodedInputStream.cs
@@ -373,9 +373,9 @@ namespace Google.Protobuf
lastTag = ReadRawVarint32();
}
- if (lastTag == 0)
+ if (WireFormat.GetTagFieldNumber(lastTag) == 0)
{
- // If we actually read zero, that's not a valid tag.
+ // If we actually read a tag with a field of 0, that's not a valid tag.
throw InvalidProtocolBufferException.InvalidTag();
}
return lastTag;