diff options
author | David Garcia Quintas <dgq@google.com> | 2018-03-29 10:13:14 -0700 |
---|---|---|
committer | David Garcia Quintas <dgq@google.com> | 2018-03-29 10:13:14 -0700 |
commit | d3ace6cf29778e26c97d0de138dcdd30afac07e5 (patch) | |
tree | d042bb9e4dae5c0e1133eb5ae3c28248817f0401 /src/core/ext/filters/http/client_authority_filter.cc | |
parent | fa7cbb50fe40962cf443f43cabe38e98f9f162a3 (diff) |
Fix authority fuzzing failures
Diffstat (limited to 'src/core/ext/filters/http/client_authority_filter.cc')
-rw-r--r-- | src/core/ext/filters/http/client_authority_filter.cc | 11 |
1 files changed, 9 insertions, 2 deletions
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; } |