aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/google/protobuf/wire_format.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/google/protobuf/wire_format.cc')
-rw-r--r--src/google/protobuf/wire_format.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/google/protobuf/wire_format.cc b/src/google/protobuf/wire_format.cc
index bd5b2489..d3d21c09 100644
--- a/src/google/protobuf/wire_format.cc
+++ b/src/google/protobuf/wire_format.cc
@@ -76,6 +76,8 @@ void UnknownFieldSetFieldSkipper::SkipUnknownEnum(
bool WireFormat::SkipField(io::CodedInputStream* input, uint32 tag,
UnknownFieldSet* unknown_fields) {
int number = WireFormatLite::GetTagFieldNumber(tag);
+ // Field number 0 is illegal.
+ if (number == 0) return false;
switch (WireFormatLite::GetTagWireType(tag)) {
case WireFormatLite::WIRETYPE_VARINT: {