File tree Expand file tree Collapse file tree 6 files changed +49
-15
lines changed
Expand file tree Collapse file tree 6 files changed +49
-15
lines changed Original file line number Diff line number Diff line change 1818build --action_env=CC=clang
1919build --action_env=CXX=clang++
2020
21- build:oss-fuzz --@rules_fuzzing//fuzzing:cc_engine=@rules_fuzzing_oss_fuzz//:oss_fuzz_engine
21+ build:oss-fuzz --@rules_fuzzing//fuzzing:cc_engine=@rules_fuzzing//fuzzing/engines:oss_fuzz
2222build:oss-fuzz --@rules_fuzzing//fuzzing:cc_engine_instrumentation=oss-fuzz
2323build:oss-fuzz --@rules_fuzzing//fuzzing:cc_engine_sanitizer=none
24+ build:oss-fuzz --cxxopt=-stdlib=libc++
25+ build:oss-fuzz --linkopt=-lc++
26+ build:oss-fuzz --verbose_failures
27+ build:oss-fuzz --spawn_strategy=standalone
Original file line number Diff line number Diff line change @@ -20,12 +20,12 @@ RUN apt-get update && apt-get install python3 openjdk-11-jdk -y
2020RUN git clone --depth 1 https://github.com/google/cel-cpp/
2121COPY build.sh $SRC/
2222RUN mkdir $SRC/cel-cpp/fuzz/
23+ COPY build.sh $SRC/cel-cpp
2324COPY BUILD fuzz*.cc $SRC/cel-cpp/fuzz/
24- COPY WORKSPACE .bazelrc $SRC/
25- RUN cat WORKSPACE >> $SRC/cel-cpp/WORKSPACE
25+ COPY MODULE.bazel .bazelrc $SRC/
26+ RUN cat MODULE.bazel >> $SRC/cel-cpp/MODULE.bazel
2627RUN cat .bazelrc >> $SRC/cel-cpp/.bazelrc
27- RUN echo "4.1.0" > $SRC/cel-cpp/.bazelversion
2828WORKDIR $SRC/cel-cpp
2929# This is to fix Fuzz Introspector build by using LLVM old pass manager
3030# re https://github.com/ossf/fuzz-introspector/issues/305
31- ENV OLD_LLVMPASS 1
31+ ENV OLD_LLVMPASS= 1
Original file line number Diff line number Diff line change 1+
2+ bazel_dep (name = "rules_fuzzing" , version = "0.6.0" )
Original file line number Diff line number Diff line change 1414# limitations under the License.
1515#
1616# ###############################################################################
17- export USE_BAZEL_VERSION=5.4.0
18- bazel_build_fuzz_tests
17+ export USE_BAZEL_VERSION=" 7.3.2"
18+ export CC=${CC:- clang}
19+ export CXX=${CXX:- clang++}
20+
21+ # modified version of bazel_build_fuzz_tests to work around issues with
22+ # bzlmod dependency on rules_fuzzing
23+
24+ bazel build -c opt --config=oss-fuzz //fuzz:fuzz_parse_oss_fuzz
25+
26+ for oss_fuzz_archive in $( find bazel-bin/ -name " *oss_fuzz.tar" ) ; do
27+ tar --no-same-owner -xvf " ${oss_fuzz_archive} " -C " ${OUT} "
28+ done
29+
30+ if [ " $SANITIZER " = " coverage" ]; then
31+ echo " Collecting the repository source files for coverage tracking."
32+ declare -r COVERAGE_SOURCES=" ${OUT} /proc/self/cwd"
33+ mkdir -p " ${COVERAGE_SOURCES} "
34+ declare -r RSYNC_FILTER_ARGS=(
35+ " --include" " *.h"
36+ " --include" " *.cc"
37+ " --include" " *.hpp"
38+ " --include" " *.cpp"
39+ " --include" " *.c"
40+ " --include" " *.inc"
41+ " --include" " */"
42+ " --exclude" " *"
43+ )
44+ rsync -avLk " ${RSYNC_FILTER_ARGS[@]} " \
45+ " $( bazel info execution_root) /" \
46+ " ${COVERAGE_SOURCES} /"
47+ fi
Original file line number Diff line number Diff line change 1919#include " parser/options.h"
2020#include " parser/parser.h"
2121
22- #define MAX_RECURSION 0x100
23-
2422extern " C" int LLVMFuzzerTestOneInput (const uint8_t * data, size_t size) {
2523 std::string str (reinterpret_cast <const char *>(data), size);
2624 google::api::expr::parser::ParserOptions options;
27- options.max_recursion_depth = MAX_RECURSION;
25+ options.max_recursion_depth = 128 ;
26+ options.expression_size_codepoint_limit = 1 << 20 ;
2827 try {
2928 auto parse_status = google::api::expr::parser::Parse (str, " fuzzinput" , options);
3029 if (!parse_status.ok ()) {
31- parse_status.status ().message ();
30+ static_cast < void >( parse_status.status ().message () );
3231 }
3332 } catch (const std::exception& e) {
3433 return 0 ;
Original file line number Diff line number Diff line change 1- homepage : " https://opensource.google/projects/ cel"
1+ homepage : " https://cel.dev "
22language : c++
3- primary_contact : " kyessenov@gmail .com"
3+ primary_contact : " tswadell@google .com"
44auto_ccs :
5- - " tswadell@google.com"
5+ - " jdtatum@google.com"
6+ - " kyessenov@google.com"
67- " p.antoine@catenacyber.fr"
78
89sanitizers :
@@ -13,7 +14,6 @@ main_repo: 'https://github.com/google/cel-cpp'
1314file_github_issue : True
1415
1516fuzzing_engines :
16- - afl
1717 - honggfuzz
1818 - libfuzzer
1919
You can’t perform that action at this time.
0 commit comments