From d3ace6cf29778e26c97d0de138dcdd30afac07e5 Mon Sep 17 00:00:00 2001 From: David Garcia Quintas Date: Thu, 29 Mar 2018 10:13:14 -0700 Subject: Fix authority fuzzing failures --- src/core/ext/filters/http/client_authority_filter.cc | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/core/ext/filters/http/client_authority_filter.cc') diff --git a/src/core/ext/filters/http/client_authority_filter.cc b/src/core/ext/filters/http/client_authority_filter.cc index f2b3e0fe7b..6d68ffcd21 100644 --- a/src/core/ext/filters/http/client_authority_filter.cc +++ b/src/core/ext/filters/http/client_authority_filter.cc @@ -97,8 +97,15 @@ grpc_error* init_channel_elem(grpc_channel_element* elem, "channels must explicity specify a value for this argument."); abort(); } - chand->default_authority = grpc_slice_from_copied_string( - grpc_channel_arg_get_string(default_authority_arg)); + const char* default_authority_str = + grpc_channel_arg_get_string(default_authority_arg); + if (default_authority_str == nullptr) { + gpr_log(GPR_ERROR, + "GRPC_ARG_DEFAULT_AUTHORITY channel arg. must be a string."); + abort(); + } + chand->default_authority = + grpc_slice_from_copied_string(default_authority_str); GPR_ASSERT(!args->is_last); return GRPC_ERROR_NONE; } -- cgit v1.2.3