diff --git a/src/google/protobuf/json/internal/untyped_message.cc b/src/google/protobuf/json/internal/untyped_message.cc index ee34a7f215..5e8e5944ee 100644 --- a/src/google/protobuf/json/internal/untyped_message.cc +++ b/src/google/protobuf/json/internal/untyped_message.cc @@ -468,7 +468,7 @@ absl::Status UntypedMessage::DecodeDelimited(io::CodedInputStream& stream, } if (field.proto().kind() == Field::TYPE_STRING) { if (desc_->proto().syntax() == google::protobuf::SYNTAX_PROTO3 && - utf8_range::IsStructurallyValid(buf)) { + !utf8_range::IsStructurallyValid(buf)) { return MakeProto3Utf8Error(); } }