From 240256fd2497d7ce03f38db5c399466e1bb25d37 Mon Sep 17 00:00:00 2001 From: Yash Tibrewal Date: Mon, 6 Nov 2017 16:32:29 -0800 Subject: Forward fix for PR #13235. Perform strcmp only when not NULL --- src/core/lib/security/transport/client_auth_filter.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/core/lib') diff --git a/src/core/lib/security/transport/client_auth_filter.cc b/src/core/lib/security/transport/client_auth_filter.cc index 8f7530ed27..11f5a13ccc 100644 --- a/src/core/lib/security/transport/client_auth_filter.cc +++ b/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) { -- cgit v1.2.3