aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core/end2end/fuzzers/api_fuzzer.c
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2016-10-31 09:51:07 -0700
committerGravatar Craig Tiller <ctiller@google.com>2016-10-31 09:51:07 -0700
commit50633cc20ed0cbf1bf8389309c68981cd026bd80 (patch)
treee6e71954cbc1e4fc27b83159dba0ef375cb148b3 /test/core/end2end/fuzzers/api_fuzzer.c
parent775e5b986170fad1332ae0103a108961f9973478 (diff)
Expand corpus, fix crash
Diffstat (limited to 'test/core/end2end/fuzzers/api_fuzzer.c')
-rw-r--r--test/core/end2end/fuzzers/api_fuzzer.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/test/core/end2end/fuzzers/api_fuzzer.c b/test/core/end2end/fuzzers/api_fuzzer.c
index 21a1ee8346..befd9e4735 100644
--- a/test/core/end2end/fuzzers/api_fuzzer.c
+++ b/test/core/end2end/fuzzers/api_fuzzer.c
@@ -275,7 +275,8 @@ static grpc_call_credentials *read_call_creds(input_stream *inp) {
cred_artifact_ctx ctx = CRED_ARTIFACT_CTX_INIT;
const char *access_token = read_cred_artifact(&ctx, inp, NULL, 0);
grpc_call_credentials *out =
- grpc_access_token_credentials_create(access_token, NULL);
+ access_token == NULL ? NULL : grpc_access_token_credentials_create(
+ access_token, NULL);
cred_artifact_ctx_finish(&ctx);
return out;
}
@@ -283,8 +284,10 @@ static grpc_call_credentials *read_call_creds(input_stream *inp) {
cred_artifact_ctx ctx = CRED_ARTIFACT_CTX_INIT;
const char *auth_token = read_cred_artifact(&ctx, inp, NULL, 0);
const char *auth_selector = read_cred_artifact(&ctx, inp, NULL, 0);
- grpc_call_credentials *out =
- grpc_google_iam_credentials_create(auth_token, auth_selector, NULL);
+ grpc_call_credentials *out = auth_token == NULL || auth_selector == NULL
+ ? NULL
+ : grpc_google_iam_credentials_create(
+ auth_token, auth_selector, NULL);
cred_artifact_ctx_finish(&ctx);
return out;
}