Merge pull request #13286 from yashykt/13235fix

Forward fix for PR #13235. Perform strcmp only when not NULL
pull/13167/merge
Yash Tibrewal 7 years ago committed by GitHub
commit 5d3b03f87a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      src/core/lib/security/transport/client_auth_filter.cc

@ -139,7 +139,7 @@ void grpc_auth_metadata_context_build(
method_name = gpr_strdup(last_slash + 1);
}
char* host_and_port = grpc_slice_to_c_string(call_host);
if (strcmp(url_scheme, GRPC_SSL_URL_SCHEME) == 0) {
if (url_scheme != NULL && strcmp(url_scheme, GRPC_SSL_URL_SCHEME) == 0) {
/* Remove the port if it is 443. */
char* port_delimiter = strrchr(host_and_port, ':');
if (port_delimiter != NULL && strcmp(port_delimiter + 1, "443") == 0) {

Loading…
Cancel
Save