aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core/end2end/fuzzers
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2016-04-19 19:58:36 -0700
committerGravatar Craig Tiller <ctiller@google.com>2016-04-19 19:58:36 -0700
commitcb6d406591df90a00cedbc3d0641d550be0d3c3a (patch)
tree4db1ddce0486c326d294f2a87d8cf26791aafe26 /test/core/end2end/fuzzers
parent1612abcd7a08e4d2398c26549fc218d2ea83ef14 (diff)
Clean up fuzzer a little
Diffstat (limited to 'test/core/end2end/fuzzers')
-rw-r--r--test/core/end2end/fuzzers/api_fuzzer.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/core/end2end/fuzzers/api_fuzzer.c b/test/core/end2end/fuzzers/api_fuzzer.c
index cbf98ed1f1..2c7c222fb1 100644
--- a/test/core/end2end/fuzzers/api_fuzzer.c
+++ b/test/core/end2end/fuzzers/api_fuzzer.c
@@ -643,6 +643,10 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
break;
}
size_t num_ops = next_byte(&inp);
+ if (num_ops > 6) {
+ end(&inp);
+ break;
+ }
grpc_op *ops = gpr_malloc(sizeof(grpc_op) * num_ops);
bool ok = true;
size_t i;
@@ -651,6 +655,8 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
op = &ops[i];
switch (next_byte(&inp)) {
default:
+ /* invalid value */
+ op->op = -1;
ok = false;
break;
case GRPC_OP_SEND_INITIAL_METADATA: