Index: third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_string_field.cc |
diff --git a/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_string_field.cc b/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_string_field.cc |
index 8d611b690ba2896f1fdb25e0424a86a4666faae4..3cec2b6ba868d45727dbf28b76179fd5ddbd0151 100644 |
--- a/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_string_field.cc |
+++ b/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_string_field.cc |
@@ -398,7 +398,8 @@ GenerateMergeFromCodedStream(io::Printer* printer) const { |
descriptor_->type() == FieldDescriptor::TYPE_STRING) { |
printer->Print(variables_, |
"::google::protobuf::internal::WireFormat::VerifyUTF8String(\n" |
- " this->$name$(0).data(), this->$name$(0).length(),\n" |
+ " this->$name$(this->$name$_size() - 1).data(),\n" |
+ " this->$name$(this->$name$_size() - 1).length(),\n" |
" ::google::protobuf::internal::WireFormat::PARSE);\n"); |
} |
} |