Skip to content

Commit

Permalink
Make Java-lite reject unmatched end-group tag.
Browse files Browse the repository at this point in the history
This brings it into conformance with our spec and other languages.

PiperOrigin-RevId: 702432195
  • Loading branch information
mkruskal-google authored and copybara-github committed Dec 3, 2024
1 parent 8f6afdc commit 84e81cf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 0 additions & 4 deletions conformance/failure_list_java_lite.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,3 @@

Required.*.ProtobufInput.PrematureEofInDelimitedDataForKnownNonRepeatedValue.MESSAGE # Should have failed to parse, but didn't.
Required.*.ProtobufInput.PrematureEofInDelimitedDataForKnownRepeatedValue.MESSAGE # Should have failed to parse, but didn't.
Required.*.ProtobufInput.UnmatchedEndGroup # Should have failed to parse, but didn't.
Required.*.ProtobufInput.UnmatchedEndGroupUnknown # Should have failed to parse, but didn't.
Required.*.ProtobufInput.UnmatchedEndGroupWithData # Should have failed to parse, but didn't.
Required.*.ProtobufInput.UnmatchedEndGroupWrongType # Should have failed to parse, but didn't.
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ final boolean mergeOneFieldFrom(B unknownFields, Reader reader, int currentDepth
addGroup(unknownFields, fieldNumber, toImmutable(subFields));
return true;
case WireFormat.WIRETYPE_END_GROUP:
if (currentDepth == 0) {
throw InvalidProtocolBufferException.invalidEndTag();
}
return false;
default:
throw InvalidProtocolBufferException.invalidWireType();
Expand Down

0 comments on commit 84e81cf

Please sign in to comment.