From 0a60bdc070d22a74dc95be9b0509a9c3380955b9 Mon Sep 17 00:00:00 2001 From: Miguel Young de la Sota Date: Thu, 22 Sep 2022 12:29:04 -0400 Subject: [PATCH] Fix a UAF in descriptor.cc that slipped past CI --- src/google/protobuf/descriptor.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/google/protobuf/descriptor.cc b/src/google/protobuf/descriptor.cc index dfe89c7073..3a089e3e94 100644 --- a/src/google/protobuf/descriptor.cc +++ b/src/google/protobuf/descriptor.cc @@ -5553,7 +5553,7 @@ void DescriptorBuilder::CheckFieldJsonNameUniqueness( absl::string_view existing_type = match.is_custom ? "custom" : "default"; // If the matched name differs (which it can only differ in case), include // it in the error message, for maximum clarity to user. - absl::string_view name_suffix = ""; + std::string name_suffix; if (details.orig_name != match.orig_name) { name_suffix = absl::StrCat(" (\"", match.orig_name, "\")"); }