diff options
author | Craig Tiller <ctiller@google.com> | 2016-04-19 19:58:36 -0700 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2016-04-19 19:58:36 -0700 |
commit | cb6d406591df90a00cedbc3d0641d550be0d3c3a (patch) | |
tree | 4db1ddce0486c326d294f2a87d8cf26791aafe26 | |
parent | 1612abcd7a08e4d2398c26549fc218d2ea83ef14 (diff) |
Clean up fuzzer a little
-rw-r--r-- | test/core/end2end/fuzzers/api_fuzzer.c | 6 |
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: |