mirror of https://github.com/google/oss-fuzz.git
cel-cpp: fix build (#5921)
Signed-off-by: Kuat Yessenov <kuat@google.com>
This commit is contained in:
parent
7602748c2b
commit
a69e7d7bb7
|
@ -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
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue