From 81041edfaea0f9ff7f724a0079542abd544f62e4 Mon Sep 17 00:00:00 2001 From: Mike Kruskal Date: Tue, 28 May 2024 14:32:15 -0700 Subject: [PATCH] Fix latent bug disallowing certain MessageSet extensions PiperOrigin-RevId: 638025707 --- src/google/protobuf/descriptor.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/google/protobuf/descriptor.cc b/src/google/protobuf/descriptor.cc index 6bcb556950..eb45d425ed 100644 --- a/src/google/protobuf/descriptor.cc +++ b/src/google/protobuf/descriptor.cc @@ -7340,7 +7340,8 @@ void DescriptorBuilder::CrossLinkField(FieldDescriptor* field, // from other extendees (< 2^29). If unknown deps are allowed, we may not // have that information, and wrongly deem the extension as invalid. auto skip_check = get_allow_unknown(pool_) && - proto.extendee() == "google.protobuf.bridge.MessageSet"; + absl::StripPrefix(proto.extendee(), ".") == + "google.protobuf.bridge.MessageSet"; if (!skip_check) { AddError(field->full_name(), proto, DescriptorPool::ErrorCollector::NUMBER, [&] {