aboutsummaryrefslogtreecommitdiff
path: root/projects/cel-cpp/fuzz_parse.cc
diff options
context:
space:
mode:
Diffstat (limited to 'projects/cel-cpp/fuzz_parse.cc')
-rw-r--r--projects/cel-cpp/fuzz_parse.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/projects/cel-cpp/fuzz_parse.cc b/projects/cel-cpp/fuzz_parse.cc
index f4755d319..8aaba0bba 100644
--- a/projects/cel-cpp/fuzz_parse.cc
+++ b/projects/cel-cpp/fuzz_parse.cc
@@ -16,14 +16,17 @@
#include <string>
+#include "parser/options.h"
#include "parser/parser.h"
#define MAX_RECURSION 0x100
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
std::string str (reinterpret_cast<const char*>(data), size);
+ google::api::expr::parser::ParserOptions options;
+ options.max_recursion_depth = MAX_RECURSION;
try {
- auto parse_status = google::api::expr::parser::Parse(str, "fuzzinput", MAX_RECURSION);
+ auto parse_status = google::api::expr::parser::Parse(str, "fuzzinput", options);
if (!parse_status.ok()) {
parse_status.status().message();
}