Fix a UAF in descriptor.cc that slipped past CI

pull/10635/head
Miguel Young de la Sota 2 years ago
parent d3b5389301
commit 0a60bdc070
  1. 2
      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, "\")");
}

Loading…
Cancel
Save