aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Noah Eisen <ncteisen@google.com>2017-04-24 11:51:07 -0700
committerGravatar Noah Eisen <ncteisen@google.com>2017-04-24 11:51:07 -0700
commitd3ba7cbc8c26659983d9f4a15ad58a17d4a56bb2 (patch)
treef85aba1b0a178cd4e7bf966c6275440a6b1e649f /src
parent18548b8a0b2b703380e0c9525eb143027eaab9f3 (diff)
Don't abort on input
Diffstat (limited to 'src')
-rw-r--r--src/core/lib/channel/connected_channel.c4
-rw-r--r--src/core/lib/security/transport/client_auth_filter.c10
2 files changed, 11 insertions, 3 deletions
diff --git a/src/core/lib/channel/connected_channel.c b/src/core/lib/channel/connected_channel.c
index 22caf24373..d8985268eb 100644
--- a/src/core/lib/channel/connected_channel.c
+++ b/src/core/lib/channel/connected_channel.c
@@ -128,7 +128,9 @@ static grpc_error *init_channel_elem(grpc_exec_ctx *exec_ctx,
static void destroy_channel_elem(grpc_exec_ctx *exec_ctx,
grpc_channel_element *elem) {
channel_data *cd = (channel_data *)elem->channel_data;
- grpc_transport_destroy(exec_ctx, cd->transport);
+ if (cd->transport) {
+ grpc_transport_destroy(exec_ctx, cd->transport);
+ }
}
static char *con_get_peer(grpc_exec_ctx *exec_ctx, grpc_call_element *elem) {
diff --git a/src/core/lib/security/transport/client_auth_filter.c b/src/core/lib/security/transport/client_auth_filter.c
index f526653ffa..1f0daf7325 100644
--- a/src/core/lib/security/transport/client_auth_filter.c
+++ b/src/core/lib/security/transport/client_auth_filter.c
@@ -343,8 +343,16 @@ static grpc_error *init_channel_elem(grpc_exec_ctx *exec_ctx,
grpc_channel_element_args *args) {
grpc_security_connector *sc =
grpc_security_connector_find_in_args(args->channel_args);
+ if (sc == NULL) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "Security connector missing from client auth filter args");
+ }
grpc_auth_context *auth_context =
grpc_find_auth_context_in_args(args->channel_args);
+ if (auth_context == NULL) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "Auth context missing from client auth filter args");
+ }
/* grab pointers to our data from the channel element */
channel_data *chand = elem->channel_data;
@@ -353,8 +361,6 @@ static grpc_error *init_channel_elem(grpc_exec_ctx *exec_ctx,
handle the case that there's no 'next' filter to call on the up or down
path */
GPR_ASSERT(!args->is_last);
- GPR_ASSERT(sc != NULL);
- GPR_ASSERT(auth_context != NULL);
/* initialize members */
chand->security_connector =