From ae4a2472b9b158fd4b248e34dd89dc9eb66d965d Mon Sep 17 00:00:00 2001 From: Ashitha Santhosh Date: Mon, 17 Aug 2020 16:41:18 -0700 Subject: [PATCH] Remove cast. --- src/core/lib/security/authorization/evaluate_args.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/core/lib/security/authorization/evaluate_args.cc b/src/core/lib/security/authorization/evaluate_args.cc index 2d88ab808a6..dc6484550a4 100644 --- a/src/core/lib/security/authorization/evaluate_args.cc +++ b/src/core/lib/security/authorization/evaluate_args.cc @@ -76,10 +76,10 @@ absl::string_view EvaluateArgs::GetSpiffeId() const { grpc_auth_property_iterator it = grpc_auth_context_find_properties_by_name( auth_context_, GRPC_PEER_SPIFFE_ID_PROPERTY_NAME); const grpc_auth_property* prop = grpc_auth_property_iterator_next(&it); - if (prop == nullptr || grpc_auth_property_iterator_next(&it) != nullptr) + if (prop == nullptr || grpc_auth_property_iterator_next(&it) != nullptr) { return ""; - return absl::string_view( - reinterpret_cast(prop->value, prop->value_length)); + } + return absl::string_view(prop->value, prop->value_length); } absl::string_view EvaluateArgs::GetCertServerName() const { @@ -89,8 +89,9 @@ absl::string_view EvaluateArgs::GetCertServerName() const { grpc_auth_property_iterator it = grpc_auth_context_find_properties_by_name( auth_context_, GRPC_X509_CN_PROPERTY_NAME); const grpc_auth_property* prop = grpc_auth_property_iterator_next(&it); - if (prop == nullptr || grpc_auth_property_iterator_next(&it) != nullptr) + if (prop == nullptr || grpc_auth_property_iterator_next(&it) != nullptr) { return ""; + } return absl::string_view(prop->value, prop->value_length); }