From a69e7d7bb7cd7de341e87a5ac3443cd140e4364b Mon Sep 17 00:00:00 2001 From: Kuat Date: Tue, 15 Jun 2021 10:16:20 -0700 Subject: [PATCH] cel-cpp: fix build (#5921) Signed-off-by: Kuat Yessenov --- projects/cel-cpp/Dockerfile | 2 +- projects/cel-cpp/fuzz_parse.cc | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/projects/cel-cpp/Dockerfile b/projects/cel-cpp/Dockerfile index 6c4b67eef..9ed7c9496 100644 --- a/projects/cel-cpp/Dockerfile +++ b/projects/cel-cpp/Dockerfile @@ -23,5 +23,5 @@ COPY BUILD fuzz*.cc $SRC/cel-cpp/fuzz/ COPY WORKSPACE .bazelrc $SRC/ RUN cat WORKSPACE >> $SRC/cel-cpp/WORKSPACE RUN cat .bazelrc >> $SRC/cel-cpp/.bazelrc -RUN echo "4.0.0" > $SRC/cel-cpp/.bazelversion +RUN echo "4.1.0" > $SRC/cel-cpp/.bazelversion WORKDIR $SRC/cel-cpp 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 +#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(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(); }