mirror of https://github.com/google/oss-fuzz.git
cmark: Update seed corpus (#9564)
Generate seed corpus from our own test suite instead of relying on an external repo. Also remove redundant $SRC/cmark from paths.
This commit is contained in:
parent
77250f109b
commit
d6dd123afc
|
@ -15,7 +15,7 @@
|
|||
################################################################################
|
||||
|
||||
FROM gcr.io/oss-fuzz-base/base-builder
|
||||
RUN apt-get update && apt-get install -y make cmake
|
||||
RUN apt-get update && apt-get install -y make cmake python3
|
||||
RUN git clone --depth 1 https://github.com/commonmark/cmark.git cmark
|
||||
WORKDIR cmark
|
||||
COPY build.sh *.dict *.options $SRC/
|
||||
|
|
|
@ -17,22 +17,14 @@
|
|||
|
||||
make -j$(nproc) cmake_build
|
||||
|
||||
$CC $CFLAGS -Isrc -Ibuild/src -c $SRC/cmark/test/cmark-fuzz.c -o cmark_fuzzer.o
|
||||
$CC $CFLAGS -Isrc -Ibuild/src -c test/cmark-fuzz.c -o cmark_fuzzer.o
|
||||
$CXX $CXXFLAGS $LIB_FUZZING_ENGINE cmark_fuzzer.o build/src/libcmark.a -o $OUT/cmark_fuzzer
|
||||
|
||||
cp $SRC/*.options $OUT/
|
||||
cp $SRC/cmark/test/fuzzing_dictionary $OUT/cmark.dict
|
||||
cp test/fuzzing_dictionary $OUT/cmark.dict
|
||||
|
||||
mkdir -p corpus
|
||||
cp $SRC/cmark/test/afl_test_cases/* corpus
|
||||
|
||||
git clone --depth 1 https://github.com/michelf/mdtest.git mdtest
|
||||
find mdtest/*.mdtest -type f -name '*.text' | while read in_file
|
||||
do
|
||||
# Genreate unique name for each input...
|
||||
out_file=$(sha1sum "$in_file" | cut -c 1-32)
|
||||
# ... and prepend a four-byte 'options' header
|
||||
printf "\0\0\0\0" > "corpus/$out_file"
|
||||
cat "$in_file" >> "corpus/$out_file"
|
||||
done
|
||||
python3 test/spec_tests.py --fuzz-corpus corpus --spec test/spec.txt
|
||||
python3 test/spec_tests.py --fuzz-corpus corpus --spec test/regression.txt
|
||||
python3 test/spec_tests.py --fuzz-corpus corpus --spec test/smart_punct.txt
|
||||
zip -j $OUT/cmark_fuzzer_seed_corpus.zip corpus/*
|
||||
|
|
Loading…
Reference in New Issue