From fc982c0177ff34835dc160bf95e87c42603f3c3f Mon Sep 17 00:00:00 2001 From: Protobuf Team Bot Date: Thu, 11 Jan 2024 09:01:30 -0800 Subject: [PATCH] Fix missing ! making it so untyped_message would trigger a invalid Utf8 error IFF the string was _valid_ UTF8. PiperOrigin-RevId: 597570464 --- src/google/protobuf/json/internal/untyped_message.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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(); } }