|
17 | 17 | import com.google.protobuf.UnittestImportPublicLite.PublicImportMessageLite;
|
18 | 18 | import com.google.protobuf.UnittestLite.ForeignEnumLite;
|
19 | 19 | import com.google.protobuf.UnittestLite.ForeignMessageLite;
|
20 |
| -import com.google.protobuf.UnittestLite.RecursiveGroup; |
21 | 20 | import com.google.protobuf.UnittestLite.RecursiveMessage;
|
22 | 21 | import com.google.protobuf.UnittestLite.TestAllExtensionsLite;
|
23 | 22 | import com.google.protobuf.UnittestLite.TestAllTypesLite;
|
@@ -2614,17 +2613,6 @@ public void testParseFromBytes_recursiveMessages() throws Exception {
|
2614 | 2613 | assertThat(thrown).hasMessageThat().contains("Protocol message had too many levels of nesting");
|
2615 | 2614 | }
|
2616 | 2615 |
|
2617 |
| - @Test |
2618 |
| - public void testParseFromBytes_recursiveKnownGroups() throws Exception { |
2619 |
| - byte[] data99 = makeRecursiveGroup(99).toByteArray(); |
2620 |
| - byte[] data100 = makeRecursiveGroup(100).toByteArray(); |
2621 |
| - |
2622 |
| - RecursiveGroup unused = RecursiveGroup.parseFrom(data99); |
2623 |
| - Throwable thrown = |
2624 |
| - assertThrows(InvalidProtocolBufferException.class, () -> RecursiveGroup.parseFrom(data100)); |
2625 |
| - assertThat(thrown).hasMessageThat().contains("Protocol message had too many levels of nesting"); |
2626 |
| - } |
2627 |
| - |
2628 | 2616 | @Test
|
2629 | 2617 | @SuppressWarnings("ProtoParseFromByteString")
|
2630 | 2618 | public void testMaliciousSGroupTagsWithMapField_fromByteArray() throws Exception {
|
@@ -3043,12 +3031,4 @@ private static RecursiveMessage makeRecursiveMessage(int num) {
|
3043 | 3031 | return RecursiveMessage.newBuilder().setRecurse(makeRecursiveMessage(num - 1)).build();
|
3044 | 3032 | }
|
3045 | 3033 | }
|
3046 |
| - |
3047 |
| - private static RecursiveGroup makeRecursiveGroup(int num) { |
3048 |
| - if (num == 0) { |
3049 |
| - return RecursiveGroup.getDefaultInstance(); |
3050 |
| - } else { |
3051 |
| - return RecursiveGroup.newBuilder().setRecurse(makeRecursiveGroup(num - 1)).build(); |
3052 |
| - } |
3053 |
| - } |
3054 | 3034 | }
|
0 commit comments