aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Mark D. Roth <roth@google.com>2017-02-01 09:15:46 -0800
committerGravatar Mark D. Roth <roth@google.com>2017-02-01 09:15:46 -0800
commit30d3a6892dc4ce2532a820046d3dd8285a20845a (patch)
treed82d71f9ecb32ea46c78da6a35c3689edd9571b8 /src
parent4d1bc51b5acc549157c129c82e9fcd109aad2b2c (diff)
Check for target being NULL in client channel factory.
Diffstat (limited to 'src')
-rw-r--r--src/core/ext/transport/chttp2/client/insecure/channel_create.c4
-rw-r--r--src/core/ext/transport/chttp2/client/secure/secure_channel_create.c4
2 files changed, 8 insertions, 0 deletions
diff --git a/src/core/ext/transport/chttp2/client/insecure/channel_create.c b/src/core/ext/transport/chttp2/client/insecure/channel_create.c
index b987086db6..490a0c560e 100644
--- a/src/core/ext/transport/chttp2/client/insecure/channel_create.c
+++ b/src/core/ext/transport/chttp2/client/insecure/channel_create.c
@@ -64,6 +64,10 @@ static grpc_channel *client_channel_factory_create_channel(
grpc_exec_ctx *exec_ctx, grpc_client_channel_factory *cc_factory,
const char *target, grpc_client_channel_type type,
const grpc_channel_args *args) {
+ if (target == NULL) {
+ gpr_log(GPR_ERROR, "cannot create channel with NULL target name");
+ return NULL;
+ }
// Add channel arg containing the server URI.
grpc_arg arg;
arg.type = GRPC_ARG_STRING;
diff --git a/src/core/ext/transport/chttp2/client/secure/secure_channel_create.c b/src/core/ext/transport/chttp2/client/secure/secure_channel_create.c
index 149d5e1863..f351010d98 100644
--- a/src/core/ext/transport/chttp2/client/secure/secure_channel_create.c
+++ b/src/core/ext/transport/chttp2/client/secure/secure_channel_create.c
@@ -66,6 +66,10 @@ static grpc_channel *client_channel_factory_create_channel(
grpc_exec_ctx *exec_ctx, grpc_client_channel_factory *cc_factory,
const char *target, grpc_client_channel_type type,
const grpc_channel_args *args) {
+ if (target == NULL) {
+ gpr_log(GPR_ERROR, "cannot create channel with NULL target name");
+ return NULL;
+ }
// Add channel arg containing the server URI.
grpc_arg arg;
arg.type = GRPC_ARG_STRING;